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

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

Issue 2436893002: [Extensions] Convert some callers of ModuleSystem::CallModuleMethod (Closed)
Patch Set: 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/messaging_bindings.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/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 v8::Context::Scope context_scope(context->v8_context()); 174 v8::Context::Scope context_scope(context->v8_context());
175 175
176 std::unique_ptr<content::V8ValueConverter> converter( 176 std::unique_ptr<content::V8ValueConverter> converter(
177 content::V8ValueConverter::create()); 177 content::V8ValueConverter::create());
178 178
179 std::vector<v8::Local<v8::Value>> arguments; 179 std::vector<v8::Local<v8::Value>> arguments;
180 for (const auto& arg : *args) { 180 for (const auto& arg : *args) {
181 arguments.push_back(converter->ToV8Value(arg.get(), context->v8_context())); 181 arguments.push_back(converter->ToV8Value(arg.get(), context->v8_context()));
182 } 182 }
183 183
184 context->module_system()->CallModuleMethod( 184 context->module_system()->CallModuleMethodSafe(
185 module_name, method_name, &arguments); 185 module_name, method_name, &arguments);
186 } 186 }
187 187
188 // This handles the "chrome." root API object in script contexts. 188 // This handles the "chrome." root API object in script contexts.
189 class ChromeNativeHandler : public ObjectBackedNativeHandler { 189 class ChromeNativeHandler : public ObjectBackedNativeHandler {
190 public: 190 public:
191 explicit ChromeNativeHandler(ScriptContext* context) 191 explicit ChromeNativeHandler(ScriptContext* context)
192 : ObjectBackedNativeHandler(context) { 192 : ObjectBackedNativeHandler(context) {
193 RouteFunction( 193 RouteFunction(
194 "GetChrome", 194 "GetChrome",
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 // The "guestViewDeny" module must always be loaded last. It registers 1652 // The "guestViewDeny" module must always be loaded last. It registers
1653 // error-providing custom elements for the GuestView types that are not 1653 // error-providing custom elements for the GuestView types that are not
1654 // available, and thus all of those types must have been checked and loaded 1654 // available, and thus all of those types must have been checked and loaded
1655 // (or not loaded) beforehand. 1655 // (or not loaded) beforehand.
1656 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1656 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1657 module_system->Require("guestViewDeny"); 1657 module_system->Require("guestViewDeny");
1658 } 1658 }
1659 } 1659 }
1660 1660
1661 } // namespace extensions 1661 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/messaging_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698