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

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

Issue 23658056: content: Move kHttpScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 // static 99 // static
100 void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id, 100 void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id,
101 const Extension* extension) { 101 const Extension* extension) {
102 const URLPatternSet& permissions = 102 const URLPatternSet& permissions =
103 PermissionsData::GetEffectiveHostPermissions(extension); 103 PermissionsData::GetEffectiveHostPermissions(extension);
104 for (URLPatternSet::const_iterator i = permissions.begin(); 104 for (URLPatternSet::const_iterator i = permissions.begin();
105 i != permissions.end(); ++i) { 105 i != permissions.end(); ++i) {
106 const char* schemes[] = { 106 const char* schemes[] = {
107 chrome::kHttpScheme, 107 content::kHttpScheme,
108 content::kHttpsScheme, 108 content::kHttpsScheme,
109 chrome::kFileScheme, 109 chrome::kFileScheme,
110 chrome::kChromeUIScheme, 110 chrome::kChromeUIScheme,
111 }; 111 };
112 for (size_t j = 0; j < arraysize(schemes); ++j) { 112 for (size_t j = 0; j < arraysize(schemes); ++j) {
113 if (i->MatchesScheme(schemes[j])) { 113 if (i->MatchesScheme(schemes[j])) {
114 WebSecurityPolicy::addOriginAccessWhitelistEntry( 114 WebSecurityPolicy::addOriginAccessWhitelistEntry(
115 extension->url(), 115 extension->url(),
116 WebString::fromUTF8(schemes[j]), 116 WebString::fromUTF8(schemes[j]),
117 WebString::fromUTF8(i->host()), 117 WebString::fromUTF8(i->host()),
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 } else if (location == UserScript::DOCUMENT_IDLE) { 377 } else if (location == UserScript::DOCUMENT_IDLE) {
378 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); 378 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts);
379 if (num_scripts) 379 if (num_scripts)
380 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); 380 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed());
381 } else { 381 } else {
382 NOTREACHED(); 382 NOTREACHED();
383 } 383 }
384 } 384 }
385 385
386 } // namespace extensions 386 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/safe_browsing/phishing_classifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698