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

Side by Side Diff: chrome/renderer/extensions/user_script_slave.cc

Issue 6997006: iwyu: Include stringprintf.h where appropriate, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/extensions/user_script_slave.h" 5 #include "chrome/renderer/extensions/user_script_slave.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 return true; 174 return true;
175 } 175 }
176 176
177 // static 177 // static
178 void UserScriptSlave::InsertInitExtensionCode( 178 void UserScriptSlave::InsertInitExtensionCode(
179 std::vector<WebScriptSource>* sources, const std::string& extension_id) { 179 std::vector<WebScriptSource>* sources, const std::string& extension_id) {
180 DCHECK(sources); 180 DCHECK(sources);
181 bool incognito = ChromeRenderProcessObserver::is_incognito_process(); 181 bool incognito = ChromeRenderProcessObserver::is_incognito_process();
182 sources->insert(sources->begin(), WebScriptSource(WebString::fromUTF8( 182 sources->insert(sources->begin(), WebScriptSource(WebString::fromUTF8(
183 StringPrintf(kInitExtension, extension_id.c_str(), 183 base::StringPrintf(kInitExtension,
184 incognito ? "true" : "false")))); 184 extension_id.c_str(),
185 incognito ? "true" : "false"))));
185 } 186 }
186 187
187 void UserScriptSlave::InjectScripts(WebFrame* frame, 188 void UserScriptSlave::InjectScripts(WebFrame* frame,
188 UserScript::RunLocation location) { 189 UserScript::RunLocation location) {
189 GURL frame_url = GURL(frame->url()); 190 GURL frame_url = GURL(frame->url());
190 if (frame_url.is_empty()) 191 if (frame_url.is_empty())
191 return; 192 return;
192 193
193 PerfTimer timer; 194 PerfTimer timer;
194 int num_css = 0; 195 int num_css = 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (num_scripts) 270 if (num_scripts)
270 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); 271 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed());
271 } else if (location == UserScript::DOCUMENT_IDLE) { 272 } else if (location == UserScript::DOCUMENT_IDLE) {
272 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); 273 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts);
273 if (num_scripts) 274 if (num_scripts)
274 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); 275 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed());
275 } else { 276 } else {
276 NOTREACHED(); 277 NOTREACHED();
277 } 278 }
278 } 279 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698