diff options
author | georged@chromium.org <georged@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 02:32:39 +0000 |
---|---|---|
committer | georged@chromium.org <georged@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 02:32:39 +0000 |
commit | 2b4c74787671fd260552bf5e87bf79fbfe607043 (patch) | |
tree | bc398950921a402fc3e30f9d477cef8c9a3d5df8 | |
parent | 58fdedab25cd2eb56d3ae0e8429c043941b9a9cd (diff) | |
download | chromium_src-2b4c74787671fd260552bf5e87bf79fbfe607043.zip chromium_src-2b4c74787671fd260552bf5e87bf79fbfe607043.tar.gz chromium_src-2b4c74787671fd260552bf5e87bf79fbfe607043.tar.bz2 |
Review URL: http://codereview.chromium.org/42382
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12074 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/user_script_master.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc index bf0ba7e..03b54b9 100644 --- a/chrome/browser/extensions/user_script_master.cc +++ b/chrome/browser/extensions/user_script_master.cc @@ -130,9 +130,9 @@ void UserScriptMaster::ScriptReloader::NotifyMaster( static void LoadScriptContent(UserScript::File* script_file) { std::string content; - CHECK(file_util::ReadFileToString(script_file->path(), &content)) << - "Failed to read script content: " << script_file->path().value(); + file_util::ReadFileToString(script_file->path(), &content); script_file->set_content(content); + LOG(INFO) << "Loaded user script file: " << script_file->path().value(); } void UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( @@ -164,16 +164,17 @@ void UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( } } -static void LoadLoneScripts(UserScriptList lone_script) { - for (size_t i = 0; i < lone_script.size(); ++i) { - for (size_t k = 0; k < lone_script[i].js_scripts().size(); ++k) { - UserScript::File& script_file = lone_script[i].js_scripts()[k]; +static void LoadLoneScripts(UserScriptList* lone_scripts) { + for (size_t i = 0; i < lone_scripts->size(); ++i) { + UserScript& script = lone_scripts->at(i); + for (size_t k = 0; k < script.js_scripts().size(); ++k) { + UserScript::File& script_file = script.js_scripts()[k]; if (script_file.GetContent().empty()) { LoadScriptContent(&script_file); } } - for (size_t k = 0; k < lone_script[i].css_scripts().size(); ++k) { - UserScript::File& script_file = lone_script[i].css_scripts()[k]; + for (size_t k = 0; k < script.css_scripts().size(); ++k) { + UserScript::File& script_file = script.css_scripts()[k]; if (script_file.GetContent().empty()) { LoadScriptContent(&script_file); } @@ -230,7 +231,7 @@ void UserScriptMaster::ScriptReloader::RunScan( if (!script_dir.empty()) LoadScriptsFromDirectory(script_dir, &scripts); - LoadLoneScripts(lone_script); + LoadLoneScripts(&lone_script); // Merge with the explicit scripts scripts.reserve(scripts.size() + lone_script.size()); |