Chromium Code Reviews| 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_EXTENSION_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
| 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
| 14 #include "base/timer.h" | 14 #include "base/timer.h" |
| 15 #include "content/public/renderer/render_process_observer.h" | 15 #include "content/public/renderer/render_process_observer.h" |
| 16 #include "chrome/common/extensions/extension_set.h" | 16 #include "chrome/common/extensions/extension_set.h" |
| 17 #include "chrome/common/extensions/feature.h" | 17 #include "chrome/common/extensions/feature.h" |
| 18 #include "chrome/renderer/extensions/chrome_v8_context.h" | 18 #include "chrome/renderer/extensions/chrome_v8_context.h" |
| 19 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 19 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
| 20 #include "chrome/renderer/extensions/v8_schema_registry.h" | |
| 20 #include "chrome/renderer/resource_bundle_source_map.h" | 21 #include "chrome/renderer/resource_bundle_source_map.h" |
| 21 #include "v8/include/v8.h" | 22 #include "v8/include/v8.h" |
| 22 | 23 |
| 23 class ModuleSystem; | 24 class ModuleSystem; |
| 24 class GURL; | 25 class GURL; |
| 25 class URLPattern; | 26 class URLPattern; |
| 26 class UserScriptSlave; | 27 class UserScriptSlave; |
| 27 struct ExtensionMsg_Loaded_Params; | 28 struct ExtensionMsg_Loaded_Params; |
| 28 | 29 |
| 29 namespace WebKit { | 30 namespace WebKit { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 48 const std::set<std::string>& function_names() const { | 49 const std::set<std::string>& function_names() const { |
| 49 return function_names_; | 50 return function_names_; |
| 50 } | 51 } |
| 51 | 52 |
| 52 bool is_extension_process() const { return is_extension_process_; } | 53 bool is_extension_process() const { return is_extension_process_; } |
| 53 const ExtensionSet* extensions() const { return &extensions_; } | 54 const ExtensionSet* extensions() const { return &extensions_; } |
| 54 const ChromeV8ContextSet& v8_context_set() const { | 55 const ChromeV8ContextSet& v8_context_set() const { |
| 55 return v8_context_set_; | 56 return v8_context_set_; |
| 56 } | 57 } |
| 57 UserScriptSlave* user_script_slave() { return user_script_slave_.get(); } | 58 UserScriptSlave* user_script_slave() { return user_script_slave_.get(); } |
| 59 extensions::V8SchemaRegistry* v8_schema_registry() { | |
| 60 return &v8_schema_registry_; | |
| 61 } | |
| 58 | 62 |
| 59 bool IsExtensionActive(const std::string& extension_id) const; | 63 bool IsExtensionActive(const std::string& extension_id) const; |
| 60 | 64 |
| 61 // Finds the extension ID for the JavaScript context associated with the | 65 // Finds the extension ID for the JavaScript context associated with the |
| 62 // specified |frame| and isolated world. If |world_id| is zero, finds the | 66 // specified |frame| and isolated world. If |world_id| is zero, finds the |
| 63 // extension ID associated with the main world's JavaScript context. If the | 67 // extension ID associated with the main world's JavaScript context. If the |
| 64 // JavaScript context isn't from an extension, returns empty string. | 68 // JavaScript context isn't from an extension, returns empty string. |
| 65 std::string GetExtensionID(WebKit::WebFrame* frame, int world_id); | 69 std::string GetExtensionID(WebKit::WebFrame* frame, int world_id); |
| 66 | 70 |
| 67 // See WebKit::WebPermissionClient::allowScriptExtension | 71 // See WebKit::WebPermissionClient::allowScriptExtension |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 std::string test_extension_id_; | 195 std::string test_extension_id_; |
| 192 | 196 |
| 193 // Status of webrequest usage for known extensions. | 197 // Status of webrequest usage for known extensions. |
| 194 // TODO(mpcomplete): remove. http://crbug.com/100411 | 198 // TODO(mpcomplete): remove. http://crbug.com/100411 |
| 195 bool webrequest_adblock_; | 199 bool webrequest_adblock_; |
| 196 bool webrequest_adblock_plus_; | 200 bool webrequest_adblock_plus_; |
| 197 bool webrequest_other_; | 201 bool webrequest_other_; |
| 198 | 202 |
| 199 ResourceBundleSourceMap source_map_; | 203 ResourceBundleSourceMap source_map_; |
| 200 | 204 |
| 205 // Process-wide (since ExtensionDispatcher is process wide) cache for the v8 | |
|
Aaron Boodman
2012/03/07 21:07:10
Don't add the bit about 'process-wide'. That is re
not at google - send to devlin
2012/03/08 00:00:33
Done.
| |
| 206 // representation of extension API schemas. | |
| 207 extensions::V8SchemaRegistry v8_schema_registry_; | |
| 208 | |
| 201 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 209 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
| 202 }; | 210 }; |
| 203 | 211 |
| 204 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 212 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
| OLD | NEW |