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 18 matching lines...) Expand all Loading... |
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 | 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. | 36 // committed, this is the commited URL. Otherwise it is the provisional URL. |
37 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame); | 37 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame); |
38 | 38 |
| 39 // Get the URL of a frame, based on its securityOrigin. If the security origin |
| 40 // is unique, the frame's URL is returned instead. |
| 41 static GURL GetOriginURLForFrame(const blink::WebFrame* frame); |
| 42 |
39 explicit UserScriptSlave(const ExtensionSet* extensions); | 43 explicit UserScriptSlave(const ExtensionSet* extensions); |
40 ~UserScriptSlave(); | 44 ~UserScriptSlave(); |
41 | 45 |
42 // Returns the unique set of extension IDs this UserScriptSlave knows about. | 46 // Returns the unique set of extension IDs this UserScriptSlave knows about. |
43 void GetActiveExtensions(std::set<std::string>* extension_ids); | 47 void GetActiveExtensions(std::set<std::string>* extension_ids); |
44 | 48 |
45 // Update the parsed scripts from shared memory. | 49 // Update the parsed scripts from shared memory. |
46 bool UpdateScripts(base::SharedMemoryHandle shared_memory); | 50 bool UpdateScripts(base::SharedMemoryHandle shared_memory); |
47 | 51 |
48 // Inject the appropriate scripts into a frame based on its URL. | 52 // Inject the appropriate scripts into a frame based on its URL. |
(...skipping 30 matching lines...) Expand all Loading... |
79 | 83 |
80 typedef std::map<std::string, int> IsolatedWorldMap; | 84 typedef std::map<std::string, int> IsolatedWorldMap; |
81 IsolatedWorldMap isolated_world_ids_; | 85 IsolatedWorldMap isolated_world_ids_; |
82 | 86 |
83 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); | 87 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); |
84 }; | 88 }; |
85 | 89 |
86 } // namespace extensions | 90 } // namespace extensions |
87 | 91 |
88 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ | 92 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ |
OLD | NEW |