| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |