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

Side by Side Diff: chrome/renderer/sandbox_status_extension_android.cc

Issue 2931393003: [Content] Update V8ValueConverter::create to return a std::unique_ptr (Closed)
Patch Set: rebase Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/sandbox_status_extension_android.h" 5 #include "chrome/renderer/sandbox_status_extension_android.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return; 141 return;
142 142
143 v8::Isolate* isolate = blink::MainThreadIsolate(); 143 v8::Isolate* isolate = blink::MainThreadIsolate();
144 v8::HandleScope handle_scope(isolate); 144 v8::HandleScope handle_scope(isolate);
145 v8::Local<v8::Context> context = 145 v8::Local<v8::Context> context =
146 render_frame()->GetWebFrame()->MainWorldScriptContext(); 146 render_frame()->GetWebFrame()->MainWorldScriptContext();
147 v8::Context::Scope context_scope(context); 147 v8::Context::Scope context_scope(context);
148 v8::Local<v8::Function> callback_local = 148 v8::Local<v8::Function> callback_local =
149 v8::Local<v8::Function>::New(isolate, *callback); 149 v8::Local<v8::Function>::New(isolate, *callback);
150 150
151 std::unique_ptr<content::V8ValueConverter> converter( 151 v8::Local<v8::Value> argv[] = {
152 content::V8ValueConverter::create()); 152 content::V8ValueConverter::Create()->ToV8Value(status.get(), context)};
153
154 v8::Local<v8::Value> argv[] = {converter->ToV8Value(status.get(), context)};
155 render_frame()->GetWebFrame()->CallFunctionEvenIfScriptDisabled( 153 render_frame()->GetWebFrame()->CallFunctionEvenIfScriptDisabled(
156 callback_local, v8::Object::New(isolate), 1, argv); 154 callback_local, v8::Object::New(isolate), 1, argv);
157 } 155 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/platform_keys_natives.cc ('k') | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698