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

Unified Diff: chrome/browser/geolocation/chrome_geolocation_permission_context.cc

Issue 7328029: Use process-per-app-instance for hosted apps without background permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incognito function. Created 9 years, 5 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
Index: chrome/browser/geolocation/chrome_geolocation_permission_context.cc
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index c2db97f8fd8b7d77c4b6f3635ecdad77edfba5d3..6e8ed8e2d30107194bd4a407404e034b65d01a0b 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -22,7 +22,7 @@
#include "chrome/common/pref_names.h"
#include "content/browser/browser_thread.h"
#include "content/browser/geolocation/geolocation_provider.h"
-#include "content/browser/renderer_host/render_process_host.h"
+#include "content/browser/renderer_host/render_view_host.h"
#include "content/common/content_notification_types.h"
#include "content/common/notification_registrar.h"
#include "content/common/notification_source.h"
@@ -519,12 +519,18 @@ void ChromeGeolocationPermissionContext::RequestGeolocationPermission(
if (!ext)
ext = extensions->GetExtensionByWebExtent(requesting_frame);
if (ext && ext->HasAPIPermission(ExtensionAPIPermission::kGeolocation)) {
- ExtensionProcessManager* epm = profile_->GetExtensionProcessManager();
- RenderProcessHost* process = epm->GetExtensionProcess(requesting_frame);
- if (process && process->id() == render_process_id) {
- NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
- requesting_frame, true);
- return;
+ // Make sure this matches the current extension.
+ RenderViewHost* rvh = RenderViewHost::FromID(render_process_id,
+ render_view_id);
+ if (rvh && rvh->site_instance()) {
+ ExtensionProcessManager* epm = profile_->GetExtensionProcessManager();
+ const Extension* current_ext = epm->GetExtensionForSiteInstance(
+ rvh->site_instance()->id());
+ if (ext == current_ext) {
+ NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
+ requesting_frame, true);
+ return;
+ }
}
}
}
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/test/data/extensions/api_test/app_process/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698