| 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_USER_SCRIPT_SLAVE_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ |
| 6 #define CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 using blink::WebScriptSource; | 26 using blink::WebScriptSource; |
| 27 | 27 |
| 28 namespace extensions { | 28 namespace extensions { |
| 29 class Extension; | 29 class Extension; |
| 30 class ExtensionSet; | 30 class ExtensionSet; |
| 31 | 31 |
| 32 // Manages installed UserScripts for a render process. | 32 // Manages installed UserScripts for a render process. |
| 33 class UserScriptSlave { | 33 class UserScriptSlave { |
| 34 public: | 34 public: |
| 35 // Utility to get the URL we will match against for a frame. If the frame has | |
| 36 // committed, this is the commited URL. Otherwise it is the provisional URL. | |
| 37 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame); | |
| 38 | |
| 39 explicit UserScriptSlave(const ExtensionSet* extensions); | 35 explicit UserScriptSlave(const ExtensionSet* extensions); |
| 40 ~UserScriptSlave(); | 36 ~UserScriptSlave(); |
| 41 | 37 |
| 42 // Returns the unique set of extension IDs this UserScriptSlave knows about. | 38 // Returns the unique set of extension IDs this UserScriptSlave knows about. |
| 43 void GetActiveExtensions(std::set<std::string>* extension_ids); | 39 void GetActiveExtensions(std::set<std::string>* extension_ids); |
| 44 | 40 |
| 45 // Update the parsed scripts from shared memory. | 41 // Update the parsed scripts from shared memory. |
| 46 bool UpdateScripts(base::SharedMemoryHandle shared_memory); | 42 bool UpdateScripts(base::SharedMemoryHandle shared_memory); |
| 47 | 43 |
| 48 // Inject the appropriate scripts into a frame based on its URL. | 44 // Inject the appropriate scripts into a frame based on its URL. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 | 75 |
| 80 typedef std::map<std::string, int> IsolatedWorldMap; | 76 typedef std::map<std::string, int> IsolatedWorldMap; |
| 81 IsolatedWorldMap isolated_world_ids_; | 77 IsolatedWorldMap isolated_world_ids_; |
| 82 | 78 |
| 83 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); | 79 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); |
| 84 }; | 80 }; |
| 85 | 81 |
| 86 } // namespace extensions | 82 } // namespace extensions |
| 87 | 83 |
| 88 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ | 84 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ |
| OLD | NEW |