Remove base::Value::CreateNullValue
This change removes base::Value::CreateNullValue in favor of Value's default constructor. In particular, this change
- Replaces |Value::CreateNullValue()| with |MakeUnique<Value>()|.
- Adds #includes of base/memory/ptr_util.h where needed.
- Replaces |std::unique_ptr<Value>| with |auto| where appropriate.
- Replaces |*Value::CreateNullValue()| with |Value()|.
- Replaces |Value::CreateNullValue().release()| with |new Value()|.
BUG=646113
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
Review-Url: https://codereview.chromium.org/2792573002
Cr-Commit-Position: refs/heads/master@{#462794}
diff --git a/content/renderer/stats_collection_controller.cc b/content/renderer/stats_collection_controller.cc
index c4f4fc93..a86aabeda 100644
--- a/content/renderer/stats_collection_controller.cc
+++ b/content/renderer/stats_collection_controller.cc
@@ -5,6 +5,7 @@
#include "content/renderer/stats_collection_controller.h"
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/statistics_recorder.h"
#include "base/strings/string_util.h"
@@ -55,13 +56,13 @@
base::DictionaryValue item;
if (load_start_time.is_null()) {
- item.Set("load_start_ms", base::Value::CreateNullValue());
+ item.Set("load_start_ms", base::MakeUnique<base::Value>());
} else {
item.SetDouble("load_start_ms", (load_start_time - base::Time::UnixEpoch())
.InMillisecondsF());
}
if (load_start_time.is_null() || load_stop_time.is_null()) {
- item.Set("load_duration_ms", base::Value::CreateNullValue());
+ item.Set("load_duration_ms", base::MakeUnique<base::Value>());
} else {
item.SetDouble("load_duration_ms",
(load_stop_time - load_start_time).InMillisecondsF());