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

Side by Side Diff: extensions/renderer/render_frame_observer_natives.cc

Issue 2339683006: [Blink] Modify SuspendableScriptExecutor to take a v8::Function (Closed)
Patch Set: Win compile fix Created 4 years, 2 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
« no previous file with comments | « extensions/renderer/module_system.cc ('k') | extensions/renderer/script_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/render_frame_observer_natives.h" 5 #include "extensions/renderer/render_frame_observer_natives.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 args.GetReturnValue().Set(true); 98 args.GetReturnValue().Set(true);
99 } 99 }
100 100
101 void RenderFrameObserverNatives::InvokeCallback( 101 void RenderFrameObserverNatives::InvokeCallback(
102 v8::Global<v8::Function> callback, 102 v8::Global<v8::Function> callback,
103 bool succeeded) { 103 bool succeeded) {
104 v8::Isolate* isolate = context()->isolate(); 104 v8::Isolate* isolate = context()->isolate();
105 v8::HandleScope handle_scope(isolate); 105 v8::HandleScope handle_scope(isolate);
106 v8::Local<v8::Value> args[] = {v8::Boolean::New(isolate, succeeded)}; 106 v8::Local<v8::Value> args[] = {v8::Boolean::New(isolate, succeeded)};
107 context()->CallFunction(v8::Local<v8::Function>::New(isolate, callback), 107 context()->SafeCallFunction(v8::Local<v8::Function>::New(isolate, callback),
108 arraysize(args), args); 108 arraysize(args), args);
109 } 109 }
110 110
111 } // namespace extensions 111 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/module_system.cc ('k') | extensions/renderer/script_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698