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

Side by Side Diff: chrome/browser/extensions/user_script_master.cc

Issue 6242010: Refactor away most of ExtensionRendererInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/extensions/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 229 }
230 } 230 }
231 } 231 }
232 232
233 // Pickle user scripts and return pointer to the shared memory. 233 // Pickle user scripts and return pointer to the shared memory.
234 static base::SharedMemory* Serialize(const UserScriptList& scripts) { 234 static base::SharedMemory* Serialize(const UserScriptList& scripts) {
235 Pickle pickle; 235 Pickle pickle;
236 pickle.WriteSize(scripts.size()); 236 pickle.WriteSize(scripts.size());
237 for (size_t i = 0; i < scripts.size(); i++) { 237 for (size_t i = 0; i < scripts.size(); i++) {
238 const UserScript& script = scripts[i]; 238 const UserScript& script = scripts[i];
239 // TODO(aa): This can be replaced by sending content script metadata to
240 // renderers along with other extension data in ViewMsg_ExtensionLoaded.
241 // See crbug.com/70516.
239 script.Pickle(&pickle); 242 script.Pickle(&pickle);
240 // Write scripts as 'data' so that we can read it out in the slave without 243 // Write scripts as 'data' so that we can read it out in the slave without
241 // allocating a new string. 244 // allocating a new string.
242 for (size_t j = 0; j < script.js_scripts().size(); j++) { 245 for (size_t j = 0; j < script.js_scripts().size(); j++) {
243 base::StringPiece contents = script.js_scripts()[j].GetContent(); 246 base::StringPiece contents = script.js_scripts()[j].GetContent();
244 pickle.WriteData(contents.data(), contents.length()); 247 pickle.WriteData(contents.data(), contents.length());
245 } 248 }
246 for (size_t j = 0; j < script.css_scripts().size(); j++) { 249 for (size_t j = 0; j < script.css_scripts().size(); j++) {
247 base::StringPiece contents = script.css_scripts()[j].GetContent(); 250 base::StringPiece contents = script.css_scripts()[j].GetContent();
248 pickle.WriteData(contents.data(), contents.length()); 251 pickle.WriteData(contents.data(), contents.length());
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 DCHECK(false); 397 DCHECK(false);
395 } 398 }
396 } 399 }
397 400
398 void UserScriptMaster::StartScan() { 401 void UserScriptMaster::StartScan() {
399 if (!script_reloader_) 402 if (!script_reloader_)
400 script_reloader_ = new ScriptReloader(this); 403 script_reloader_ = new ScriptReloader(this);
401 404
402 script_reloader_->StartScan(user_script_dir_, lone_scripts_); 405 script_reloader_->StartScan(user_script_dir_, lone_scripts_);
403 } 406 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698