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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return new_id; 85 return new_id;
86 } 86 }
87 87
88 std::string UserScriptSlave::GetExtensionIdForIsolatedWorld( 88 std::string UserScriptSlave::GetExtensionIdForIsolatedWorld(
89 int isolated_world_id) { 89 int isolated_world_id) {
90 for (IsolatedWorldMap::iterator iter = isolated_world_ids_.begin(); 90 for (IsolatedWorldMap::iterator iter = isolated_world_ids_.begin();
91 iter != isolated_world_ids_.end(); ++iter) { 91 iter != isolated_world_ids_.end(); ++iter) {
92 if (iter->second == isolated_world_id) 92 if (iter->second == isolated_world_id)
93 return iter->first; 93 return iter->first;
94 } 94 }
95 return ""; 95 return std::string();
96 } 96 }
97 97
98 // static 98 // static
99 void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id, 99 void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id,
100 const Extension* extension) { 100 const Extension* extension) {
101 const URLPatternSet& permissions = 101 const URLPatternSet& permissions =
102 extension->GetEffectiveHostPermissions(); 102 extension->GetEffectiveHostPermissions();
103 for (URLPatternSet::const_iterator i = permissions.begin(); 103 for (URLPatternSet::const_iterator i = permissions.begin();
104 i != permissions.end(); ++i) { 104 i != permissions.end(); ++i) {
105 const char* schemes[] = { 105 const char* schemes[] = {
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } else if (location == UserScript::DOCUMENT_IDLE) { 374 } else if (location == UserScript::DOCUMENT_IDLE) {
375 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); 375 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts);
376 if (num_scripts) 376 if (num_scripts)
377 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); 377 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed());
378 } else { 378 } else {
379 NOTREACHED(); 379 NOTREACHED();
380 } 380 }
381 } 381 }
382 382
383 } // namespace extensions 383 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/user_script_scheduler.cc ('k') | chrome/renderer/plugins/plugin_uma_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698