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

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

Issue 2423043003: [Extensions] Convert some callers of ScriptContext::CallFunction (Closed)
Patch Set: d'oh 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 | « no previous file | extensions/renderer/json_schema_unittest.cc » ('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/extension_helper.h" 5 #include "extensions/renderer/extension_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 void ExtensionHelper::OnAppWindowClosed() { 68 void ExtensionHelper::OnAppWindowClosed() {
69 v8::HandleScope scope(v8::Isolate::GetCurrent()); 69 v8::HandleScope scope(v8::Isolate::GetCurrent());
70 v8::Local<v8::Context> v8_context = 70 v8::Local<v8::Context> v8_context =
71 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); 71 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext();
72 ScriptContext* script_context = 72 ScriptContext* script_context =
73 dispatcher_->script_context_set().GetByV8Context(v8_context); 73 dispatcher_->script_context_set().GetByV8Context(v8_context);
74 if (!script_context) 74 if (!script_context)
75 return; 75 return;
76 script_context->module_system()->CallModuleMethod("app.window", 76 script_context->module_system()->CallModuleMethodSafe("app.window",
77 "onAppWindowClosed"); 77 "onAppWindowClosed");
78 } 78 }
79 79
80 } // namespace extensions 80 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/json_schema_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698