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

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

Issue 2657613005: [Extensions Bindings] Add chrome.runtime.lastError support (Closed)
Patch Set: . Created 3 years, 10 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
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 #ifndef EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ 5 #ifndef EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_
6 #define EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ 6 #define EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void SendRequest(std::unique_ptr<APIBinding::Request> request, 61 void SendRequest(std::unique_ptr<APIBinding::Request> request,
62 v8::Local<v8::Context> context); 62 v8::Local<v8::Context> context);
63 63
64 // Called when listeners for a given event have changed, and forwards it along 64 // Called when listeners for a given event have changed, and forwards it along
65 // to |send_event_listener_ipc_|. 65 // to |send_event_listener_ipc_|.
66 void OnEventListenerChanged(const std::string& event_name, 66 void OnEventListenerChanged(const std::string& event_name,
67 binding::EventListenersChanged change, 67 binding::EventListenersChanged change,
68 v8::Local<v8::Context> context); 68 v8::Local<v8::Context> context);
69 69
70 // Getter callback for an extension API, since APIs are constructed lazily. 70 // Getter callback for an extension API, since APIs are constructed lazily.
71 static void GetAPIHelper(v8::Local<v8::Name> name, 71 static void BindingAccessor(v8::Local<v8::Name> name,
72 const v8::PropertyCallbackInfo<v8::Value>& info); 72 const v8::PropertyCallbackInfo<v8::Value>& info);
73
74 // Creates and returns the API binding for the given |name|.
75 static v8::Local<v8::Object> GetAPIHelper(v8::Local<v8::Context> context,
76 v8::Local<v8::String> name);
77
78 // Gets the chrome.runtime API binding.
79 static v8::Local<v8::Object> GetRuntime(v8::Local<v8::Context> context);
73 80
74 // Handler to send request IPCs. Abstracted out for testing purposes. 81 // Handler to send request IPCs. Abstracted out for testing purposes.
75 SendRequestIPCMethod send_request_ipc_; 82 SendRequestIPCMethod send_request_ipc_;
76 83
77 // Handler to notify the browser of event registrations. Abstracted out for 84 // Handler to notify the browser of event registrations. Abstracted out for
78 // testing purposes. 85 // testing purposes.
79 SendEventListenerIPCMethod send_event_listener_ipc_; 86 SendEventListenerIPCMethod send_event_listener_ipc_;
80 87
81 // The APIBindingsSystem associated with this class. 88 // The APIBindingsSystem associated with this class.
82 APIBindingsSystem api_system_; 89 APIBindingsSystem api_system_;
83 90
84 base::WeakPtrFactory<NativeExtensionBindingsSystem> weak_factory_; 91 base::WeakPtrFactory<NativeExtensionBindingsSystem> weak_factory_;
85 92
86 DISALLOW_COPY_AND_ASSIGN(NativeExtensionBindingsSystem); 93 DISALLOW_COPY_AND_ASSIGN(NativeExtensionBindingsSystem);
87 }; 94 };
88 95
89 } // namespace extensions 96 } // namespace extensions
90 97
91 #endif // EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ 98 #endif // EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698