Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Unified Diff: content/child/v8_value_converter_impl.cc

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | content/child/v8_value_converter_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/v8_value_converter_impl.cc
diff --git a/content/child/v8_value_converter_impl.cc b/content/child/v8_value_converter_impl.cc
index b445760fcaeccd5a51e9843f1401237214a8c016..1391adf3b84626ccfd0d43b1bcc428857b01da96 100644
--- a/content/child/v8_value_converter_impl.cc
+++ b/content/child/v8_value_converter_impl.cc
@@ -358,7 +358,7 @@ std::unique_ptr<base::Value> V8ValueConverterImpl::FromV8ValueImpl(
return nullptr;
if (val->IsNull())
- return base::Value::CreateNullValue();
+ return base::MakeUnique<base::Value>();
if (val->IsBoolean())
return base::MakeUnique<base::Value>(val->ToBoolean(isolate)->Value());
@@ -442,7 +442,7 @@ std::unique_ptr<base::Value> V8ValueConverterImpl::FromV8Array(
v8::Isolate* isolate) const {
ScopedUniquenessGuard uniqueness_guard(state, val);
if (!uniqueness_guard.is_valid())
- return base::Value::CreateNullValue();
+ return base::MakeUnique<base::Value>();
std::unique_ptr<v8::Context::Scope> scope;
// If val was created in a different context than our current one, change to
@@ -475,7 +475,7 @@ std::unique_ptr<base::Value> V8ValueConverterImpl::FromV8Array(
}
if (!val->HasRealIndexedProperty(i)) {
- result->Append(base::Value::CreateNullValue());
+ result->Append(base::MakeUnique<base::Value>());
continue;
}
@@ -486,7 +486,7 @@ std::unique_ptr<base::Value> V8ValueConverterImpl::FromV8Array(
else
// JSON.stringify puts null in places where values don't serialize, for
// example undefined and functions. Emulate that behavior.
- result->Append(base::Value::CreateNullValue());
+ result->Append(base::MakeUnique<base::Value>());
}
return std::move(result);
}
@@ -522,7 +522,7 @@ std::unique_ptr<base::Value> V8ValueConverterImpl::FromV8Object(
v8::Isolate* isolate) const {
ScopedUniquenessGuard uniqueness_guard(state, val);
if (!uniqueness_guard.is_valid())
- return base::Value::CreateNullValue();
+ return base::MakeUnique<base::Value>();
std::unique_ptr<v8::Context::Scope> scope;
// If val was created in a different context than our current one, change to
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | content/child/v8_value_converter_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698