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

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

Issue 2575173002: [Extensions Bindings] Add a bridge to use current custom bindings (Closed)
Patch Set: . Created 4 years 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_binding_unittest.cc ('k') | extensions/renderer/api_bindings_system.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 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_API_BINDINGS_SYSTEM_H_ 5 #ifndef EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_
6 #define EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ 6 #define EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 APIBindingsSystem(const binding::RunJSFunction& call_js, 51 APIBindingsSystem(const binding::RunJSFunction& call_js,
52 const GetAPISchemaMethod& get_api_schema, 52 const GetAPISchemaMethod& get_api_schema,
53 const SendRequestMethod& send_request); 53 const SendRequestMethod& send_request);
54 ~APIBindingsSystem(); 54 ~APIBindingsSystem();
55 55
56 // Returns a new v8::Object representing the api specified by |api_name|. 56 // Returns a new v8::Object representing the api specified by |api_name|.
57 v8::Local<v8::Object> CreateAPIInstance( 57 v8::Local<v8::Object> CreateAPIInstance(
58 const std::string& api_name, 58 const std::string& api_name,
59 v8::Local<v8::Context> context, 59 v8::Local<v8::Context> context,
60 v8::Isolate* isolate, 60 v8::Isolate* isolate,
61 const APIBinding::AvailabilityCallback& is_available); 61 const APIBinding::AvailabilityCallback& is_available,
62 v8::Local<v8::Object>* hooks_interface_out);
62 63
63 // Responds to the request with the given |request_id|, calling the callback 64 // Responds to the request with the given |request_id|, calling the callback
64 // with |response|. 65 // with |response|.
65 void CompleteRequest(int request_id, const base::ListValue& response); 66 void CompleteRequest(int request_id, const base::ListValue& response);
66 67
67 // Notifies the APIEventHandler to fire the corresponding event, notifying 68 // Notifies the APIEventHandler to fire the corresponding event, notifying
68 // listeners. 69 // listeners.
69 void FireEventInContext(const std::string& event_name, 70 void FireEventInContext(const std::string& event_name,
70 v8::Local<v8::Context> context, 71 v8::Local<v8::Context> context,
71 const base::ListValue& response); 72 const base::ListValue& response);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // purposes. Typically, this would send an IPC to the browser to begin the 120 // purposes. Typically, this would send an IPC to the browser to begin the
120 // function work. 121 // function work.
121 SendRequestMethod send_request_; 122 SendRequestMethod send_request_;
122 123
123 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); 124 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem);
124 }; 125 };
125 126
126 } // namespace 127 } // namespace
127 128
128 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ 129 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_
OLDNEW
« no previous file with comments | « extensions/renderer/api_binding_unittest.cc ('k') | extensions/renderer/api_bindings_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698