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

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

Issue 169053005: Allow cross-origin XHR in unblessed extension context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dispatcher.h" 5 #include "chrome/renderer/extensions/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 Feature::Context context_type = ClassifyJavaScriptContext( 1126 Feature::Context context_type = ClassifyJavaScriptContext(
1127 extension, 1127 extension,
1128 extension_group, 1128 extension_group,
1129 UserScriptSlave::GetDataSourceURLForFrame(frame), 1129 UserScriptSlave::GetDataSourceURLForFrame(frame),
1130 frame->document().securityOrigin()); 1130 frame->document().securityOrigin());
1131 1131
1132 ChromeV8Context* context = 1132 ChromeV8Context* context =
1133 new ChromeV8Context(v8_context, frame, extension, context_type); 1133 new ChromeV8Context(v8_context, frame, extension, context_type);
1134 v8_context_set_.Add(context); 1134 v8_context_set_.Add(context);
1135 1135
1136 if (context_type == Feature::UNBLESSED_EXTENSION_CONTEXT) {
1137 AddOrRemoveOriginPermissions(
1138 UpdatedExtensionPermissionsInfo::ADDED,
1139 extension,
1140 PermissionsData::GetEffectiveHostPermissions(extension));
1141 }
not at google - send to devlin 2014/02/19 17:10:51 if you extend this to all extension contexts (i.e.
1142
1136 { 1143 {
1137 scoped_ptr<ModuleSystem> module_system(new ModuleSystem(context, 1144 scoped_ptr<ModuleSystem> module_system(new ModuleSystem(context,
1138 &source_map_)); 1145 &source_map_));
1139 context->set_module_system(module_system.Pass()); 1146 context->set_module_system(module_system.Pass());
1140 } 1147 }
1141 ModuleSystem* module_system = context->module_system(); 1148 ModuleSystem* module_system = context->module_system();
1142 1149
1143 // Enable natives in startup. 1150 // Enable natives in startup.
1144 ModuleSystem::NativesEnabledScope natives_enabled_scope( 1151 ModuleSystem::NativesEnabledScope natives_enabled_scope(
1145 module_system); 1152 module_system);
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 } 1691 }
1685 1692
1686 void Dispatcher::ClearPortData(int port_id) { 1693 void Dispatcher::ClearPortData(int port_id) {
1687 // Only the target port side has entries in |port_to_tab_id_map_|. If 1694 // Only the target port side has entries in |port_to_tab_id_map_|. If
1688 // |port_id| is a source port, std::map::erase() will just silently fail 1695 // |port_id| is a source port, std::map::erase() will just silently fail
1689 // here as a no-op. 1696 // here as a no-op.
1690 port_to_tab_id_map_.erase(port_id); 1697 port_to_tab_id_map_.erase(port_id);
1691 } 1698 }
1692 1699
1693 } // namespace extensions 1700 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698