summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-10 01:13:53 +0000
committerlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-10 01:13:53 +0000
commitdda09bb85b5edff392b47ba48e464295afda4612 (patch)
treef6e2a541e8da7cb81231469144a298154152a027
parent0a4720bf1047a8a6e54fb10794294b35238cae42 (diff)
downloadchromium_src-dda09bb85b5edff392b47ba48e464295afda4612.zip
chromium_src-dda09bb85b5edff392b47ba48e464295afda4612.tar.gz
chromium_src-dda09bb85b5edff392b47ba48e464295afda4612.tar.bz2
Make BPGeolocationPermissionContext singleton.
BUG=None Test=WebViewTest.Geolocation* still passes. Review URL: https://chromiumcodereview.appspot.com/13497005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193279 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 310dbbe..f81ad0c0 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -232,6 +232,9 @@ class RendererURLRequestContextSelector
base::LazyInstance<IDMap<RenderProcessHost> >::Leaky
g_all_hosts = LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<scoped_refptr<BrowserPluginGeolocationPermissionContext> >
+ g_browser_plugin_geolocation_context = LAZY_INSTANCE_INITIALIZER;
+
// Map of site to process, to ensure we only have one RenderProcessHost per
// site in process-per-site mode. Each map is specific to a BrowserContext.
class SiteProcessMap : public base::SupportsUserData::Data {
@@ -594,8 +597,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
GetID(),
storage_partition_impl_->GetIndexedDBContext()));
if (IsGuest()) {
+ if (!g_browser_plugin_geolocation_context.Get()) {
+ g_browser_plugin_geolocation_context.Get() =
+ new BrowserPluginGeolocationPermissionContext();
+ }
channel_->AddFilter(GeolocationDispatcherHost::New(
- GetID(), new BrowserPluginGeolocationPermissionContext()));
+ GetID(), g_browser_plugin_geolocation_context.Get()));
} else {
channel_->AddFilter(GeolocationDispatcherHost::New(
GetID(), browser_context->GetGeolocationPermissionContext()));