Index: chrome/renderer/extensions/user_script_slave.h |
diff --git a/chrome/renderer/extensions/user_script_slave.h b/chrome/renderer/extensions/user_script_slave.h |
index f5037ac675c231e441e4f87b7ce6807c8a13f24c..e2b57d2e5316834642fc63c6f28ec1083e73e3d2 100644 |
--- a/chrome/renderer/extensions/user_script_slave.h |
+++ b/chrome/renderer/extensions/user_script_slave.h |
@@ -17,6 +17,7 @@ |
#include "chrome/common/extensions/user_script.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
+class Extension; |
class ExtensionSet; |
namespace WebKit { |
@@ -28,7 +29,7 @@ using WebKit::WebScriptSource; |
// Manages installed UserScripts for a render process. |
class UserScriptSlave { |
public: |
- UserScriptSlave(const ExtensionSet* extensions); |
+ explicit UserScriptSlave(const ExtensionSet* extensions); |
~UserScriptSlave(); |
// Returns the unique set of extension IDs this UserScriptSlave knows about. |
@@ -42,11 +43,18 @@ class UserScriptSlave { |
// testability. |
void InjectScripts(WebKit::WebFrame* frame, UserScript::RunLocation location); |
- static int GetIsolatedWorldId(const std::string& extension_id); |
+ // Gets the isolated world ID to use for the given |extension| in the given |
+ // |frame|. If no isolated world has been created for that extension, |
+ // one will be created and initialized. |
+ static int GetIsolatedWorldId(const Extension* extension, |
+ WebKit::WebFrame* frame); |
static void InsertInitExtensionCode(std::vector<WebScriptSource>* sources, |
const std::string& extension_id); |
private: |
+ static void InitializeIsolatedWorld(int isolated_world_id, |
+ const Extension* extension); |
+ |
// Shared memory containing raw script data. |
scoped_ptr<base::SharedMemory> shared_memory_; |