| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class WebFrame; | 26 class WebFrame; |
| 27 } | 27 } |
| 28 | 28 |
| 29 using WebKit::WebScriptSource; | 29 using WebKit::WebScriptSource; |
| 30 | 30 |
| 31 // Manages installed UserScripts for a render process. | 31 // Manages installed UserScripts for a render process. |
| 32 class UserScriptSlave { | 32 class UserScriptSlave { |
| 33 public: | 33 public: |
| 34 // Utility to get the URL we will match against for a frame. If the frame has | 34 // Utility to get the URL we will match against for a frame. If the frame has |
| 35 // committed, this is the commited URL. Otherwise it is the provisional URL. | 35 // committed, this is the commited URL. Otherwise it is the provisional URL. |
| 36 static GURL GetLatestURLForFrame(WebKit::WebFrame* frame); | 36 static GURL GetDataSourceURLForFrame(WebKit::WebFrame* frame); |
| 37 | 37 |
| 38 explicit UserScriptSlave(const ExtensionSet* extensions); | 38 explicit UserScriptSlave(const ExtensionSet* extensions); |
| 39 ~UserScriptSlave(); | 39 ~UserScriptSlave(); |
| 40 | 40 |
| 41 // Returns the unique set of extension IDs this UserScriptSlave knows about. | 41 // Returns the unique set of extension IDs this UserScriptSlave knows about. |
| 42 void GetActiveExtensions(std::set<std::string>* extension_ids); | 42 void GetActiveExtensions(std::set<std::string>* extension_ids); |
| 43 | 43 |
| 44 // Update the parsed scripts from shared memory. | 44 // Update the parsed scripts from shared memory. |
| 45 bool UpdateScripts(base::SharedMemoryHandle shared_memory); | 45 bool UpdateScripts(base::SharedMemoryHandle shared_memory); |
| 46 | 46 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Extension metadata. | 79 // Extension metadata. |
| 80 const ExtensionSet* extensions_; | 80 const ExtensionSet* extensions_; |
| 81 | 81 |
| 82 typedef std::map<std::string, int> IsolatedWorldMap; | 82 typedef std::map<std::string, int> IsolatedWorldMap; |
| 83 IsolatedWorldMap isolated_world_ids_; | 83 IsolatedWorldMap isolated_world_ids_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); | 85 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ | 88 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ |
| OLD | NEW |