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

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

Issue 2727583004: [Extensions Bindings] Add a registerEventArgumentMassager (Closed)
Patch Set: . Created 3 years, 9 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/api_event_handler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/native_extension_bindings_system.h" 5 #include "extensions/renderer/native_extension_bindings_system.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 APIBindingsSystem* bindings_system, 180 APIBindingsSystem* bindings_system,
181 v8::Local<v8::Function> get_internal_api) { 181 v8::Local<v8::Function> get_internal_api) {
182 APIBindingHooks* hooks = nullptr; 182 APIBindingHooks* hooks = nullptr;
183 v8::Local<v8::Object> binding_object = bindings_system->CreateAPIInstance( 183 v8::Local<v8::Object> binding_object = bindings_system->CreateAPIInstance(
184 name, context, context->GetIsolate(), 184 name, context, context->GetIsolate(),
185 base::Bind(&IsAPIMethodAvailable, script_context), &hooks); 185 base::Bind(&IsAPIMethodAvailable, script_context), &hooks);
186 186
187 gin::Handle<APIBindingBridge> bridge_handle = gin::CreateHandle( 187 gin::Handle<APIBindingBridge> bridge_handle = gin::CreateHandle(
188 context->GetIsolate(), 188 context->GetIsolate(),
189 new APIBindingBridge(bindings_system->type_reference_map(), 189 new APIBindingBridge(bindings_system->type_reference_map(),
190 bindings_system->request_handler(), hooks, context, 190 bindings_system->request_handler(),
191 bindings_system->event_handler(), hooks, context,
191 binding_object, script_context->GetExtensionID(), 192 binding_object, script_context->GetExtensionID(),
192 script_context->GetContextTypeDescription(), 193 script_context->GetContextTypeDescription(),
193 base::Bind(&CallJsFunction))); 194 base::Bind(&CallJsFunction)));
194 v8::Local<v8::Value> native_api_bridge = bridge_handle.ToV8(); 195 v8::Local<v8::Value> native_api_bridge = bridge_handle.ToV8();
195 script_context->module_system()->OnNativeBindingCreated( 196 script_context->module_system()->OnNativeBindingCreated(
196 name, native_api_bridge, get_internal_api); 197 name, native_api_bridge, get_internal_api);
197 198
198 return binding_object; 199 return binding_object;
199 } 200 }
200 201
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 630
630 void NativeExtensionBindingsSystem::OnEventListenerChanged( 631 void NativeExtensionBindingsSystem::OnEventListenerChanged(
631 const std::string& event_name, 632 const std::string& event_name,
632 binding::EventListenersChanged change, 633 binding::EventListenersChanged change,
633 v8::Local<v8::Context> context) { 634 v8::Local<v8::Context> context) {
634 send_event_listener_ipc_.Run( 635 send_event_listener_ipc_.Run(
635 change, ScriptContextSet::GetContextByV8Context(context), event_name); 636 change, ScriptContextSet::GetContextByV8Context(context), event_name);
636 } 637 }
637 638
638 } // namespace extensions 639 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_event_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698