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

Side by Side Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 173166: Implement granular cross-origin XHR for extensions. (Closed)
Patch Set: some cleanup Created 11 years, 4 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 | chrome/common/render_messages.h » ('j') | chrome/renderer/render_thread.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/browser/extensions/extension_function_dispatcher.h" 5 #include "chrome/browser/extensions/extension_function_dispatcher.h"
6 6
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/extension_bookmarks_module.h" 10 #include "chrome/browser/extensions/extension_bookmarks_module.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 all_instances()->insert(this); 217 all_instances()->insert(this);
218 218
219 // Notify the ExtensionProcessManager that the view was created. 219 // Notify the ExtensionProcessManager that the view was created.
220 ExtensionProcessManager* epm = profile()->GetExtensionProcessManager(); 220 ExtensionProcessManager* epm = profile()->GetExtensionProcessManager();
221 epm->RegisterExtensionProcess(extension_id(), 221 epm->RegisterExtensionProcess(extension_id(),
222 render_view_host->process()->pid()); 222 render_view_host->process()->pid());
223 223
224 // Update the extension permissions. Doing this each time we create an EFD 224 // Update the extension permissions. Doing this each time we create an EFD
225 // ensures that new processes are informed of permissions for newly installed 225 // ensures that new processes are informed of permissions for newly installed
226 // extensions. 226 // extensions.
227 render_view_host->Send(new ViewMsg_Extension_SetPermissions( 227 render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions(
228 extension->id(), extension->api_permissions())); 228 extension->id(), extension->api_permissions()));
229 render_view_host->Send(new ViewMsg_Extension_SetHostPermissions(
230 extension->url(), extension->host_permissions()));
229 } 231 }
230 232
231 ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() { 233 ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() {
232 all_instances()->erase(this); 234 all_instances()->erase(this);
233 peer_->dispatcher_ = NULL; 235 peer_->dispatcher_ = NULL;
234 } 236 }
235 237
236 Browser* ExtensionFunctionDispatcher::GetBrowser() { 238 Browser* ExtensionFunctionDispatcher::GetBrowser() {
237 return delegate_->GetBrowser(); 239 return delegate_->GetBrowser();
238 } 240 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } else { 272 } else {
271 NOTREACHED(); 273 NOTREACHED();
272 base::KillProcess(render_view_host_->process()->process().handle(), 274 base::KillProcess(render_view_host_->process()->process().handle(),
273 ResultCodes::KILLED_BAD_MESSAGE, false); 275 ResultCodes::KILLED_BAD_MESSAGE, false);
274 } 276 }
275 } 277 }
276 278
277 Profile* ExtensionFunctionDispatcher::profile() { 279 Profile* ExtensionFunctionDispatcher::profile() {
278 return render_view_host_->process()->profile(); 280 return render_view_host_->process()->profile();
279 } 281 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/render_messages.h » ('j') | chrome/renderer/render_thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698