OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 | 182 |
183 // Sets up the host permissions for |extension|. | 183 // Sets up the host permissions for |extension|. |
184 void InitOriginPermissions(const Extension* extension); | 184 void InitOriginPermissions(const Extension* extension); |
185 void AddOrRemoveOriginPermissions( | 185 void AddOrRemoveOriginPermissions( |
186 UpdatedExtensionPermissionsInfo::Reason reason, | 186 UpdatedExtensionPermissionsInfo::Reason reason, |
187 const Extension* extension, | 187 const Extension* extension, |
188 const URLPatternSet& origins); | 188 const URLPatternSet& origins); |
189 | 189 |
190 void RegisterNativeHandlers(ModuleSystem* module_system, | 190 void RegisterNativeHandlers(ModuleSystem* module_system, |
191 ChromeV8Context* context); | 191 ChromeV8Context* context); |
192 void RegisterSchemaGeneratedBindings(ModuleSystem* module_system, | |
193 ChromeV8Context* context, | |
194 v8::Handle<v8::Context> v8_context); | |
192 | 195 |
193 // Inserts static source code into |source_map_|. | 196 // Inserts static source code into |source_map_|. |
194 void PopulateSourceMap(); | 197 void PopulateSourceMap(); |
195 | 198 |
196 // Inserts BindingInstallers into |lazy_bindings_map_|. | 199 // Inserts BindingInstallers into |lazy_bindings_map_|. |
197 void PopulateLazyBindingsMap(); | 200 void PopulateLazyBindingsMap(); |
198 | 201 |
199 // Sets up the bindings for the given api. | 202 // Sets up the bindings for the given api. |
200 void InstallBindings(ModuleSystem* module_system, | 203 void InstallBindings(ModuleSystem* module_system, |
201 v8::Handle<v8::Context> v8_context, | 204 v8::Handle<v8::Context> v8_context, |
202 const std::string& api); | 205 const std::string& api); |
203 | 206 |
204 // Determines whether |frame| is loading a platform app resource URL. (this | 207 // Determines whether |frame| is loading a platform app resource URL. (this |
205 // evaluates to true for iframes in platform apps and sandboxed resources that | 208 // evaluates to true for iframes in platform apps and sandboxed resources that |
206 // are not in the same origin). | 209 // are not in the same origin). |
207 bool IsWithinPlatformApp(const WebKit::WebFrame* frame); | 210 bool IsWithinPlatformApp(const WebKit::WebFrame* frame); |
208 | 211 |
209 // Returns the Feature::Context type of context for a JavaScript context. | 212 // Returns the Feature::Context type of context for a JavaScript context. |
210 Feature::Context ClassifyJavaScriptContext(const std::string& extension_id, | 213 Feature::Context ClassifyJavaScriptContext(const std::string& extension_id, |
211 int extension_group, | 214 int extension_group, |
212 const ExtensionURLInfo& url_info); | 215 const ExtensionURLInfo& url_info); |
213 | 216 |
217 typedef void (ModuleSystem::*LazyFieldSetter)(v8::Handle<v8::Object>, | |
Matt Perry
2013/02/21 01:57:43
Is this used anywhere? And if so, why does it belo
cduvall
2013/02/26 00:36:57
Removed.
| |
218 const std::string&, | |
219 const std::string&, | |
220 const std::string&); | |
221 // Gets |field| from |object| or creates it as an empty object if it doesn't | |
222 // exist. | |
223 v8::Handle<v8::Object> GetOrCreateObject(v8::Handle<v8::Object> object, | |
224 const std::string& field); | |
225 | |
214 // True if this renderer is running extensions. | 226 // True if this renderer is running extensions. |
215 bool is_extension_process_; | 227 bool is_extension_process_; |
216 | 228 |
217 // Contains all loaded extensions. This is essentially the renderer | 229 // Contains all loaded extensions. This is essentially the renderer |
218 // counterpart to ExtensionService in the browser. It contains information | 230 // counterpart to ExtensionService in the browser. It contains information |
219 // about all extensions currently loaded by the browser. | 231 // about all extensions currently loaded by the browser. |
220 ExtensionSet extensions_; | 232 ExtensionSet extensions_; |
221 | 233 |
222 // All the bindings contexts that are currently loaded for this renderer. | 234 // All the bindings contexts that are currently loaded for this renderer. |
223 // There is zero or one for each v8 context. | 235 // There is zero or one for each v8 context. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 | 269 |
258 // Sends API requests to the extension host. | 270 // Sends API requests to the extension host. |
259 scoped_ptr<RequestSender> request_sender_; | 271 scoped_ptr<RequestSender> request_sender_; |
260 | 272 |
261 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 273 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
262 }; | 274 }; |
263 | 275 |
264 } // namespace extensions | 276 } // namespace extensions |
265 | 277 |
266 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 278 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
OLD | NEW |