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/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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 const base::ListValue* args, | 149 const base::ListValue* args, |
150 ScriptContext* context) { | 150 ScriptContext* context) { |
151 v8::HandleScope handle_scope(context->isolate()); | 151 v8::HandleScope handle_scope(context->isolate()); |
152 v8::Context::Scope context_scope(context->v8_context()); | 152 v8::Context::Scope context_scope(context->v8_context()); |
153 | 153 |
154 std::unique_ptr<content::V8ValueConverter> converter( | 154 std::unique_ptr<content::V8ValueConverter> converter( |
155 content::V8ValueConverter::create()); | 155 content::V8ValueConverter::create()); |
156 | 156 |
157 std::vector<v8::Local<v8::Value>> arguments; | 157 std::vector<v8::Local<v8::Value>> arguments; |
158 for (const auto& arg : *args) { | 158 for (const auto& arg : *args) { |
159 arguments.push_back(converter->ToV8Value(arg.get(), context->v8_context())); | 159 arguments.push_back(converter->ToV8Value(&arg, context->v8_context())); |
160 } | 160 } |
161 | 161 |
162 context->module_system()->CallModuleMethodSafe( | 162 context->module_system()->CallModuleMethodSafe( |
163 module_name, method_name, &arguments); | 163 module_name, method_name, &arguments); |
164 } | 164 } |
165 | 165 |
166 // This handles the "chrome." root API object in script contexts. | 166 // This handles the "chrome." root API object in script contexts. |
167 class ChromeNativeHandler : public ObjectBackedNativeHandler { | 167 class ChromeNativeHandler : public ObjectBackedNativeHandler { |
168 public: | 168 public: |
169 explicit ChromeNativeHandler(ScriptContext* context) | 169 explicit ChromeNativeHandler(ScriptContext* context) |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 // The "guestViewDeny" module must always be loaded last. It registers | 1408 // The "guestViewDeny" module must always be loaded last. It registers |
1409 // error-providing custom elements for the GuestView types that are not | 1409 // error-providing custom elements for the GuestView types that are not |
1410 // available, and thus all of those types must have been checked and loaded | 1410 // available, and thus all of those types must have been checked and loaded |
1411 // (or not loaded) beforehand. | 1411 // (or not loaded) beforehand. |
1412 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1412 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
1413 module_system->Require("guestViewDeny"); | 1413 module_system->Require("guestViewDeny"); |
1414 } | 1414 } |
1415 } | 1415 } |
1416 | 1416 |
1417 } // namespace extensions | 1417 } // namespace extensions |
OLD | NEW |