| OLD | NEW |
| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 // Getter callback for an extension API, since APIs are constructed lazily. | 80 // Getter callback for an extension API, since APIs are constructed lazily. |
| 81 static void BindingAccessor(v8::Local<v8::Name> name, | 81 static void BindingAccessor(v8::Local<v8::Name> name, |
| 82 const v8::PropertyCallbackInfo<v8::Value>& info); | 82 const v8::PropertyCallbackInfo<v8::Value>& info); |
| 83 | 83 |
| 84 // Creates and returns the API binding for the given |name|. | 84 // Creates and returns the API binding for the given |name|. |
| 85 static v8::Local<v8::Object> GetAPIHelper(v8::Local<v8::Context> context, | 85 static v8::Local<v8::Object> GetAPIHelper(v8::Local<v8::Context> context, |
| 86 v8::Local<v8::String> name); | 86 v8::Local<v8::String> name); |
| 87 | 87 |
| 88 // Gets the chrome.runtime API binding. | 88 // Gets the chrome.runtime API binding. |
| 89 static v8::Local<v8::Object> GetRuntime(v8::Local<v8::Context> context); | 89 static v8::Local<v8::Object> GetLastErrorParents( |
| 90 v8::Local<v8::Context> context, |
| 91 v8::Local<v8::Object>* secondary_parent); |
| 90 | 92 |
| 91 // Callback to get an API binding for an internal API. | 93 // Callback to get an API binding for an internal API. |
| 92 static void GetInternalAPI(const v8::FunctionCallbackInfo<v8::Value>& info); | 94 static void GetInternalAPI(const v8::FunctionCallbackInfo<v8::Value>& info); |
| 93 | 95 |
| 94 // Helper method to get a APIBindingJSUtil object for the current context, | 96 // Helper method to get a APIBindingJSUtil object for the current context, |
| 95 // and populate |binding_util_out|. We use an out parameter instead of | 97 // and populate |binding_util_out|. We use an out parameter instead of |
| 96 // returning it in order to let us use weak ptrs, which can't be used on a | 98 // returning it in order to let us use weak ptrs, which can't be used on a |
| 97 // method with a return value. | 99 // method with a return value. |
| 98 void GetJSBindingUtil(v8::Local<v8::Context> context, | 100 void GetJSBindingUtil(v8::Local<v8::Context> context, |
| 99 v8::Local<v8::Value>* binding_util_out); | 101 v8::Local<v8::Value>* binding_util_out); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 112 v8::Eternal<v8::FunctionTemplate> get_internal_api_; | 114 v8::Eternal<v8::FunctionTemplate> get_internal_api_; |
| 113 | 115 |
| 114 base::WeakPtrFactory<NativeExtensionBindingsSystem> weak_factory_; | 116 base::WeakPtrFactory<NativeExtensionBindingsSystem> weak_factory_; |
| 115 | 117 |
| 116 DISALLOW_COPY_AND_ASSIGN(NativeExtensionBindingsSystem); | 118 DISALLOW_COPY_AND_ASSIGN(NativeExtensionBindingsSystem); |
| 117 }; | 119 }; |
| 118 | 120 |
| 119 } // namespace extensions | 121 } // namespace extensions |
| 120 | 122 |
| 121 #endif // EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ | 123 #endif // EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ |
| OLD | NEW |