| Index: extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
|
| diff --git a/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc b/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
|
| index 36c2f12c5bc3b7c93c72fd003fd558821f811abd..933559e153d116ff07ce9203e101e3b6efcbfc03 100644
|
| --- a/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
|
| +++ b/extensions/browser/guest_view/web_view/web_view_content_script_manager.cc
|
| @@ -46,7 +46,7 @@ void WebViewContentScriptManager::AddContentScripts(
|
| content::RenderViewHost* render_view_host,
|
| int view_instance_id,
|
| const HostID& host_id,
|
| - const UserScriptList& scripts) {
|
| + BrowserUserScriptList& scripts) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
| DeclarativeUserScriptMaster* master =
|
| @@ -72,8 +72,8 @@ void WebViewContentScriptManager::AddContentScripts(
|
| // Step 2: updates the guest_content_script_map_.
|
| ContentScriptMap& map = iter->second;
|
| std::set<UserScriptIDPair> to_delete;
|
| - for (const UserScript& script : scripts) {
|
| - auto map_iter = map.find(script.name());
|
| + for (const std::unique_ptr<BrowserUserScript>& script : scripts) {
|
| + auto map_iter = map.find(script->name());
|
| // If a content script has the same name as the new one, remove the old
|
| // script first, and insert the new one.
|
| if (map_iter != map.end()) {
|
| @@ -81,9 +81,10 @@ void WebViewContentScriptManager::AddContentScripts(
|
| map.erase(map_iter);
|
| }
|
| map.insert(std::pair<std::string, UserScriptIDPair>(
|
| - script.name(), UserScriptIDPair(script.id(), script.host_id())));
|
| - ids_to_add.insert(script.id());
|
| + script->name(), UserScriptIDPair(script->id(), script->host_id())));
|
| + ids_to_add.insert(script->id());
|
| }
|
| +
|
| if (!to_delete.empty())
|
| master->RemoveScripts(to_delete);
|
|
|
|
|