OLD | NEW |
---|---|
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 int isolated_world_id) { | 77 int isolated_world_id) { |
78 for (IsolatedWorldMap::iterator iter = isolated_world_ids_.begin(); | 78 for (IsolatedWorldMap::iterator iter = isolated_world_ids_.begin(); |
79 iter != isolated_world_ids_.end(); ++iter) { | 79 iter != isolated_world_ids_.end(); ++iter) { |
80 if (iter->second == isolated_world_id) | 80 if (iter->second == isolated_world_id) |
81 return iter->first; | 81 return iter->first; |
82 } | 82 } |
83 return ""; | 83 return ""; |
84 } | 84 } |
85 | 85 |
86 // static | 86 // static |
87 // TODO(ericu): What needs to be done here? Do filesystem URLs enter into | |
88 // extension permissions at all? | |
Aaron Boodman
2012/01/19 23:47:37
Nothing needs to be done here for now.
| |
87 void UserScriptSlave::InitializeIsolatedWorld( | 89 void UserScriptSlave::InitializeIsolatedWorld( |
88 int isolated_world_id, | 90 int isolated_world_id, |
89 const Extension* extension) { | 91 const Extension* extension) { |
90 const URLPatternSet& permissions = | 92 const URLPatternSet& permissions = |
91 extension->GetEffectiveHostPermissions(); | 93 extension->GetEffectiveHostPermissions(); |
92 for (URLPatternSet::const_iterator i = permissions.begin(); | 94 for (URLPatternSet::const_iterator i = permissions.begin(); |
93 i != permissions.end(); ++i) { | 95 i != permissions.end(); ++i) { |
94 const char* schemes[] = { | 96 const char* schemes[] = { |
95 chrome::kHttpScheme, | 97 chrome::kHttpScheme, |
96 chrome::kHttpsScheme, | 98 chrome::kHttpsScheme, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 if (num_scripts) | 337 if (num_scripts) |
336 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); | 338 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); |
337 } else if (location == UserScript::DOCUMENT_IDLE) { | 339 } else if (location == UserScript::DOCUMENT_IDLE) { |
338 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); | 340 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); |
339 if (num_scripts) | 341 if (num_scripts) |
340 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); | 342 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); |
341 } else { | 343 } else { |
342 NOTREACHED(); | 344 NOTREACHED(); |
343 } | 345 } |
344 } | 346 } |
OLD | NEW |