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

Side by Side Diff: extensions/browser/web_ui_user_script_loader.cc

Issue 2228743002: Rework some UserScriptLoader logic in preparation to removing UserScript copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "extensions/browser/web_ui_user_script_loader.h" 5 #include "extensions/browser/web_ui_user_script_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 30 matching lines...) Expand all
41 content::BrowserContext* browser_context, 41 content::BrowserContext* browser_context,
42 const HostID& host_id) 42 const HostID& host_id)
43 : UserScriptLoader(browser_context, host_id), complete_fetchers_(0) { 43 : UserScriptLoader(browser_context, host_id), complete_fetchers_(0) {
44 SetReady(true); 44 SetReady(true);
45 } 45 }
46 46
47 WebUIUserScriptLoader::~WebUIUserScriptLoader() { 47 WebUIUserScriptLoader::~WebUIUserScriptLoader() {
48 } 48 }
49 49
50 void WebUIUserScriptLoader::AddScripts( 50 void WebUIUserScriptLoader::AddScripts(
51 const std::set<extensions::UserScript>& scripts, 51 const extensions::UserScriptList& scripts,
52 int render_process_id, 52 int render_process_id,
53 int render_view_id) { 53 int render_view_id) {
54 UserScriptRenderInfo info(render_process_id, render_view_id); 54 UserScriptRenderInfo info(render_process_id, render_view_id);
55 for (const extensions::UserScript& script : scripts) { 55 for (const extensions::UserScript& script : scripts) {
56 script_render_info_map_.insert( 56 script_render_info_map_.insert(
57 std::pair<int, UserScriptRenderInfo>(script.id(), info)); 57 std::pair<int, UserScriptRenderInfo>(script.id(), info));
58 } 58 }
59 59
60 extensions::UserScriptLoader::AddScripts(scripts); 60 extensions::UserScriptLoader::AddScripts(scripts);
61 } 61 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 } 146 }
147 147
148 void WebUIUserScriptLoader::OnWebUIURLFetchComplete() { 148 void WebUIUserScriptLoader::OnWebUIURLFetchComplete() {
149 content::BrowserThread::PostTask( 149 content::BrowserThread::PostTask(
150 content::BrowserThread::FILE, FROM_HERE, 150 content::BrowserThread::FILE, FROM_HERE,
151 base::Bind(&SerializeOnFileThread, base::Passed(&user_scripts_cache_), 151 base::Bind(&SerializeOnFileThread, base::Passed(&user_scripts_cache_),
152 scripts_loaded_callback_)); 152 scripts_loaded_callback_));
153 scripts_loaded_callback_.Reset(); 153 scripts_loaded_callback_.Reset();
154 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698