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

Unified Diff: chrome/renderer/extensions/user_script_slave.cc

Issue 169053005: Allow cross-origin XHR in unblessed extension context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove curly braces Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/user_script_slave.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/user_script_slave.cc
diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc
index fc538910c016c271713d6f8d69bbae08c28eaf9d..3c00daf064091786d7d33ec531d3d54d114bfe00 100644
--- a/chrome/renderer/extensions/user_script_slave.cc
+++ b/chrome/renderer/extensions/user_script_slave.cc
@@ -76,7 +76,6 @@ int UserScriptSlave::GetIsolatedWorldIdForExtension(const Extension* extension,
// This map will tend to pile up over time, but realistically, you're never
// going to have enough extensions for it to matter.
isolated_world_ids_[extension->id()] = new_id;
- InitializeIsolatedWorld(new_id, extension);
frame->setIsolatedWorldSecurityOrigin(
new_id,
WebSecurityOrigin::create(extension->url()));
@@ -96,31 +95,6 @@ std::string UserScriptSlave::GetExtensionIdForIsolatedWorld(
return std::string();
}
-// static
-void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id,
- const Extension* extension) {
- const URLPatternSet& permissions =
- PermissionsData::GetEffectiveHostPermissions(extension);
- for (URLPatternSet::const_iterator i = permissions.begin();
- i != permissions.end(); ++i) {
- const char* schemes[] = {
- content::kHttpScheme,
- content::kHttpsScheme,
- content::kFileScheme,
- content::kChromeUIScheme,
- };
- for (size_t j = 0; j < arraysize(schemes); ++j) {
- if (i->MatchesScheme(schemes[j])) {
- WebSecurityPolicy::addOriginAccessWhitelistEntry(
- extension->url(),
- WebString::fromUTF8(schemes[j]),
- WebString::fromUTF8(i->host()),
- i->match_subdomains());
- }
- }
- }
-}
-
void UserScriptSlave::RemoveIsolatedWorld(const std::string& extension_id) {
isolated_world_ids_.erase(extension_id);
}
« no previous file with comments | « chrome/renderer/extensions/user_script_slave.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698