Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: extensions/browser/declarative_user_script_master.h

Issue 1056533002: Implement <webview>.addContentScript/removeContentScript API [2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webview_addremove_contentscripts_2
Patch Set: nits. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/declarative_user_script_master.h
diff --git a/extensions/browser/declarative_user_script_master.h b/extensions/browser/declarative_user_script_master.h
index f5730396099498c46c1ead26a1aed2670e975992..55c94f5e1eac4cb8012e79da594836220b08f802 100644
--- a/extensions/browser/declarative_user_script_master.h
+++ b/extensions/browser/declarative_user_script_master.h
@@ -5,8 +5,11 @@
#ifndef EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_
#define EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_
+#include <set>
+
+#include "base/memory/scoped_ptr.h"
#include "base/scoped_observer.h"
-#include "extensions/browser/extension_user_script_loader.h"
+#include "extensions/common/host_id.h"
namespace content {
class BrowserContext;
@@ -15,6 +18,7 @@ class BrowserContext;
namespace extensions {
class UserScript;
+class UserScriptLoader;
// Manages declarative user scripts for a single extension. Owns a
// UserScriptLoader to which file loading and shared memory management
@@ -30,9 +34,13 @@ class DeclarativeUserScriptMaster {
// script load is in progress.
void AddScript(const UserScript& script);
- // Adds a set of scripts to shared memory region. This may not happen right
- // away if a script load is in progress.
- void AddScripts(const std::set<UserScript>& scripts);
+ // Adds a set of scripts to shared meomory region. The fetch of the content
+ // of the script on WebUI requires to start URL request to the associated
+ // render specified by |render_process_id, render_view_id|.
+ // This may not happen right away if a script load is in progress.
+ void AddScripts(const std::set<UserScript>& scripts,
+ int render_process_id,
+ int render_view_id);
// Removes script from shared memory region. This may not happen right away if
// a script load is in progress.
@@ -54,7 +62,7 @@ class DeclarativeUserScriptMaster {
// Script loader that handles loading contents of scripts into shared memory
// and notifying renderers of script updates.
- ExtensionUserScriptLoader loader_;
+ scoped_ptr<UserScriptLoader> loader_;
DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptMaster);
};

Powered by Google App Engine
This is Rietveld 408576698