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 // Returns the first non-about:-URL in the document hierarchy above and | |
40 // including |frame|. The document hierarchy is only traversed if | |
41 // |document_url| is an about:-URL and if |match_about_blank| is true. | |
42 static GURL GetEffectiveDocumentURL(const blink::WebFrame* frame, | |
43 const GURL& document_url, | |
44 bool match_about_blank); | |
45 | |
46 | |
not at google - send to devlin
2014/05/01 20:32:19
delete 1 of these blank lines
robwu
2014/05/01 21:30:38
Done.
| |
39 explicit UserScriptSlave(const ExtensionSet* extensions); | 47 explicit UserScriptSlave(const ExtensionSet* extensions); |
40 ~UserScriptSlave(); | 48 ~UserScriptSlave(); |
41 | 49 |
42 // Returns the unique set of extension IDs this UserScriptSlave knows about. | 50 // Returns the unique set of extension IDs this UserScriptSlave knows about. |
43 void GetActiveExtensions(std::set<std::string>* extension_ids); | 51 void GetActiveExtensions(std::set<std::string>* extension_ids); |
44 | 52 |
45 // Update the parsed scripts from shared memory. | 53 // Update the parsed scripts from shared memory. |
46 bool UpdateScripts(base::SharedMemoryHandle shared_memory); | 54 bool UpdateScripts(base::SharedMemoryHandle shared_memory); |
47 | 55 |
48 // Inject the appropriate scripts into a frame based on its URL. | 56 // Inject the appropriate scripts into a frame based on its URL. |
(...skipping 30 matching lines...) Expand all Loading... | |
79 | 87 |
80 typedef std::map<std::string, int> IsolatedWorldMap; | 88 typedef std::map<std::string, int> IsolatedWorldMap; |
81 IsolatedWorldMap isolated_world_ids_; | 89 IsolatedWorldMap isolated_world_ids_; |
82 | 90 |
83 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); | 91 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); |
84 }; | 92 }; |
85 | 93 |
86 } // namespace extensions | 94 } // namespace extensions |
87 | 95 |
88 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ | 96 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ |
OLD | NEW |