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

Unified Diff: extensions/renderer/activity_log_converter_strategy.cc

Issue 1899083003: Convert //extensions/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 | « no previous file | extensions/renderer/activity_log_converter_strategy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/activity_log_converter_strategy.cc
diff --git a/extensions/renderer/activity_log_converter_strategy.cc b/extensions/renderer/activity_log_converter_strategy.cc
index f76f9558e849a74ed1fd825523516a793823937d..301f2e2c24aacc793a23db1a6f514ad7448e8cae 100644
--- a/extensions/renderer/activity_log_converter_strategy.cc
+++ b/extensions/renderer/activity_log_converter_strategy.cc
@@ -4,8 +4,9 @@
#include "extensions/renderer/activity_log_converter_strategy.h"
+#include <memory>
+
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "v8/include/v8.h"
@@ -16,8 +17,8 @@ namespace {
// Summarize a V8 value. This performs a shallow conversion in all cases, and
// returns only a string with a description of the value (e.g.,
// "[HTMLElement]").
-scoped_ptr<base::Value> SummarizeV8Value(v8::Isolate* isolate,
- v8::Local<v8::Object> object) {
+std::unique_ptr<base::Value> SummarizeV8Value(v8::Isolate* isolate,
+ v8::Local<v8::Object> object) {
v8::TryCatch try_catch(isolate);
v8::Isolate::DisallowJavascriptExecutionScope scope(
isolate, v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
@@ -38,11 +39,11 @@ scoped_ptr<base::Value> SummarizeV8Value(v8::Isolate* isolate,
name = v8::String::Concat(name, v8::String::NewFromUtf8(isolate, "]"));
if (try_catch.HasCaught()) {
- return scoped_ptr<base::Value>(
+ return std::unique_ptr<base::Value>(
new base::StringValue("[JS Execution Exception]"));
}
- return scoped_ptr<base::Value>(
+ return std::unique_ptr<base::Value>(
new base::StringValue(std::string(*v8::String::Utf8Value(name))));
}
@@ -73,7 +74,7 @@ bool ActivityLogConverterStrategy::FromV8Internal(
base::Value** out,
v8::Isolate* isolate,
const FromV8ValueCallback& callback) const {
- scoped_ptr<base::Value> parsed_value;
+ std::unique_ptr<base::Value> parsed_value;
parsed_value = SummarizeV8Value(isolate, value);
*out = parsed_value.release();
« no previous file with comments | « no previous file | extensions/renderer/activity_log_converter_strategy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698