Commit 7d84bee3 authored by Charlie Hu's avatar Charlie Hu Committed by Commit Bot

Code style improvement on LocationReportBody

- Use base::make_optional instead of base::Optional constructor.
- Add const qualifier on field line_number and column_number.

Change-Id: I99145d52b98d609aaa0591722626b43093f00900
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037323
Commit-Queue: Charlie Hu <chenleihu@google.com>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738299}
parent 4e3ec245
......@@ -20,10 +20,10 @@ class CORE_EXPORT LocationReportBody : public ReportBody {
: source_file_(location->Url()),
line_number_(location->IsUnknown()
? base::nullopt
: base::Optional<uint32_t>{location->LineNumber()}),
column_number_(location->IsUnknown() ? base::nullopt
: base::Optional<uint32_t>{
location->ColumnNumber()}) {}
: base::make_optional(location->LineNumber())),
column_number_(location->IsUnknown()
? base::nullopt
: base::make_optional(location->ColumnNumber())) {}
LocationReportBody() : LocationReportBody(SourceLocation::Capture()) {}
......@@ -52,8 +52,8 @@ class CORE_EXPORT LocationReportBody : public ReportBody {
protected:
const String source_file_;
base::Optional<uint32_t> line_number_;
base::Optional<uint32_t> column_number_;
const base::Optional<uint32_t> line_number_;
const base::Optional<uint32_t> column_number_;
};
} // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment