| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ |
| 6 #define EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ | 6 #define EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ |
| 7 | 7 |
| 8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
| 9 #include "extensions/browser/user_script_loader.h" | 9 #include "extensions/browser/user_script_loader.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Adds script to shared memory region. This may not happen right away if a | 29 // Adds script to shared memory region. This may not happen right away if a |
| 30 // script load is in progress. | 30 // script load is in progress. |
| 31 void AddScript(const UserScript& script); | 31 void AddScript(const UserScript& script); |
| 32 | 32 |
| 33 // Adds a set of scripts to shared meomory region. The fetch of the content | 33 // Adds a set of scripts to shared meomory region. The fetch of the content |
| 34 // of the script on WebUI requires to start URL request to the associated | 34 // of the script on WebUI requires to start URL request to the associated |
| 35 // render specified by |render_process_id, render_view_id|. | 35 // render specified by |render_process_id, render_view_id|. |
| 36 // This may not happen right away if a script load is in progress. | 36 // This may not happen right away if a script load is in progress. |
| 37 void AddScripts(const std::set<UserScript>& scripts, | 37 void AddScripts(const std::set<UserScript>& scripts, |
| 38 int render_process_id, | 38 int render_process_id, |
| 39 int render_view_id); | 39 int render_view_id, |
| 40 bool is_incognito); |
| 40 | 41 |
| 41 // Removes script from shared memory region. This may not happen right away if | 42 // Removes script from shared memory region. This may not happen right away if |
| 42 // a script load is in progress. | 43 // a script load is in progress. |
| 43 void RemoveScript(const UserScript& script); | 44 void RemoveScript(const UserScript& script); |
| 44 | 45 |
| 45 // Removes a set of scripts from shared memory region. This may not happen | 46 // Removes a set of scripts from shared memory region. This may not happen |
| 46 // right away if a script load is in progress. | 47 // right away if a script load is in progress. |
| 47 void RemoveScripts(const std::set<UserScript>& scripts); | 48 void RemoveScripts(const std::set<UserScript>& scripts); |
| 48 | 49 |
| 49 // Removes all scripts from shared memory region. This may not happen right | 50 // Removes all scripts from shared memory region. This may not happen right |
| 50 // away if a script load is in progress. | 51 // away if a script load is in progress. |
| 51 void ClearScripts(); | 52 void ClearScripts(); |
| 52 | 53 |
| 53 const HostID& host_id() const { return host_id_; } | 54 const HostID& host_id() const { return host_id_; } |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // ID of host that owns scripts that this component manages. | 57 // ID of host that owns scripts that this component manages. |
| 57 HostID host_id_; | 58 HostID host_id_; |
| 58 | 59 |
| 59 // Script loader that handles loading contents of scripts into shared memory | 60 // Script loader that handles loading contents of scripts into shared memory |
| 60 // and notifying renderers of script updates. | 61 // and notifying renderers of script updates. |
| 61 scoped_ptr<UserScriptLoader> loader_; | 62 scoped_ptr<UserScriptLoader> loader_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptMaster); | 64 DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptMaster); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace extensions | 67 } // namespace extensions |
| 67 | 68 |
| 68 #endif // EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ | 69 #endif // EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ |
| OLD | NEW |