diff options
author | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 13:58:48 +0000 |
---|---|---|
committer | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 13:58:48 +0000 |
commit | ecad7768a4f40e1ff1a6f1634d18a68358978cdb (patch) | |
tree | 78f530436257f410d8fa153c40cae5b35714ff0f /chrome/browser/geolocation | |
parent | 70372d49ac0fc1bbfd7e04aa820b646a6c525743 (diff) | |
download | chromium_src-ecad7768a4f40e1ff1a6f1634d18a68358978cdb.zip chromium_src-ecad7768a4f40e1ff1a6f1634d18a68358978cdb.tar.gz chromium_src-ecad7768a4f40e1ff1a6f1634d18a68358978cdb.tar.bz2 |
Geolocation dispatcher rename:
Rename GeolocationDispatcherHost to GeolocationDispatcherHostOld and GeolocationDispatcher to GeolocationDispatcherOld in preparation for the new client-based implementation.
BUG=59908
TEST=None
Review URL: http://codereview.chromium.org/3799010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation')
-rw-r--r-- | chrome/browser/geolocation/geolocation_dispatcher_host_old.cc (renamed from chrome/browser/geolocation/geolocation_dispatcher_host.cc) | 65 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_dispatcher_host_old.h (renamed from chrome/browser/geolocation/geolocation_dispatcher_host.h) | 25 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_permission_context.cc | 2 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_permission_context.h | 1 |
4 files changed, 49 insertions, 44 deletions
diff --git a/chrome/browser/geolocation/geolocation_dispatcher_host.cc b/chrome/browser/geolocation/geolocation_dispatcher_host_old.cc index 5e8209c..0af76e0 100644 --- a/chrome/browser/geolocation/geolocation_dispatcher_host.cc +++ b/chrome/browser/geolocation/geolocation_dispatcher_host_old.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/geolocation/geolocation_dispatcher_host.h" +#include "chrome/browser/geolocation/geolocation_dispatcher_host_old.h" #include <map> #include <set> @@ -19,14 +19,14 @@ #include "ipc/ipc_message.h" namespace { -class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, - public GeolocationObserver { +class GeolocationDispatcherHostOldImpl : public GeolocationDispatcherHostOld, + public GeolocationObserver { public: - GeolocationDispatcherHostImpl( + GeolocationDispatcherHostOldImpl( int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context); - // GeolocationDispatcherHost + // GeolocationDispatcherHostOld // Called to possibly handle the incoming IPC message. Returns true if // handled. Called in the browser process. virtual bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok); @@ -35,8 +35,8 @@ class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, virtual void OnLocationUpdate(const Geoposition& position); private: - friend class base::RefCountedThreadSafe<GeolocationDispatcherHostImpl>; - virtual ~GeolocationDispatcherHostImpl(); + friend class base::RefCountedThreadSafe<GeolocationDispatcherHostOldImpl>; + virtual ~GeolocationDispatcherHostOldImpl(); void OnRegisterDispatcher(int render_view_id); void OnUnregisterDispatcher(int render_view_id); @@ -70,10 +70,10 @@ class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, // Only set whilst we are registered with the arbitrator. GeolocationProvider* location_provider_; - DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHostImpl); + DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHostOldImpl); }; -GeolocationDispatcherHostImpl::GeolocationDispatcherHostImpl( +GeolocationDispatcherHostOldImpl::GeolocationDispatcherHostOldImpl( int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context) : resource_message_filter_process_id_(resource_message_filter_process_id), @@ -84,17 +84,17 @@ GeolocationDispatcherHostImpl::GeolocationDispatcherHostImpl( // a javascript geolocation object is actually initialized. } -GeolocationDispatcherHostImpl::~GeolocationDispatcherHostImpl() { +GeolocationDispatcherHostOldImpl::~GeolocationDispatcherHostOldImpl() { if (location_provider_) location_provider_->RemoveObserver(this); } -bool GeolocationDispatcherHostImpl::OnMessageReceived( +bool GeolocationDispatcherHostOldImpl::OnMessageReceived( const IPC::Message& msg, bool* msg_was_ok) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); *msg_was_ok = true; bool handled = true; - IPC_BEGIN_MESSAGE_MAP_EX(GeolocationDispatcherHostImpl, msg, *msg_was_ok) + IPC_BEGIN_MESSAGE_MAP_EX(GeolocationDispatcherHostOldImpl, msg, *msg_was_ok) IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_RegisterDispatcher, OnRegisterDispatcher) IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_UnregisterDispatcher, @@ -116,7 +116,7 @@ bool GeolocationDispatcherHostImpl::OnMessageReceived( return handled; } -void GeolocationDispatcherHostImpl::OnLocationUpdate( +void GeolocationDispatcherHostOldImpl::OnLocationUpdate( const Geoposition& geoposition) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); for (std::set<int>::iterator it = geolocation_renderer_ids_.begin(); @@ -128,19 +128,21 @@ void GeolocationDispatcherHostImpl::OnLocationUpdate( } } -void GeolocationDispatcherHostImpl::OnRegisterDispatcher(int render_view_id) { +void GeolocationDispatcherHostOldImpl::OnRegisterDispatcher( + int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(0u, geolocation_renderer_ids_.count(render_view_id)); geolocation_renderer_ids_.insert(render_view_id); } -void GeolocationDispatcherHostImpl::OnUnregisterDispatcher(int render_view_id) { +void GeolocationDispatcherHostOldImpl::OnUnregisterDispatcher( + int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(1u, geolocation_renderer_ids_.count(render_view_id)); geolocation_renderer_ids_.erase(render_view_id); } -void GeolocationDispatcherHostImpl::OnRequestPermission( +void GeolocationDispatcherHostOldImpl::OnRequestPermission( int render_view_id, int bridge_id, const GURL& requesting_frame) { @@ -152,7 +154,7 @@ void GeolocationDispatcherHostImpl::OnRequestPermission( requesting_frame); } -void GeolocationDispatcherHostImpl::OnCancelPermissionRequest( +void GeolocationDispatcherHostOldImpl::OnCancelPermissionRequest( int render_view_id, int bridge_id, const GURL& requesting_frame) { @@ -164,7 +166,7 @@ void GeolocationDispatcherHostImpl::OnCancelPermissionRequest( requesting_frame); } -void GeolocationDispatcherHostImpl::OnStartUpdating( +void GeolocationDispatcherHostOldImpl::OnStartUpdating( int render_view_id, int bridge_id, const GURL& requesting_frame, @@ -183,8 +185,8 @@ void GeolocationDispatcherHostImpl::OnStartUpdating( RefreshGeolocationObserverOptions(); } -void GeolocationDispatcherHostImpl::OnStopUpdating(int render_view_id, - int bridge_id) { +void GeolocationDispatcherHostOldImpl::OnStopUpdating(int render_view_id, + int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; @@ -194,23 +196,23 @@ void GeolocationDispatcherHostImpl::OnStopUpdating(int render_view_id, resource_message_filter_process_id_, render_view_id, bridge_id); } -void GeolocationDispatcherHostImpl::OnSuspend(int render_view_id, - int bridge_id) { +void GeolocationDispatcherHostOldImpl::OnSuspend(int render_view_id, + int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; // TODO(bulach): connect this with GeolocationArbitrator. } -void GeolocationDispatcherHostImpl::OnResume(int render_view_id, - int bridge_id) { +void GeolocationDispatcherHostOldImpl::OnResume(int render_view_id, + int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; // TODO(bulach): connect this with GeolocationArbitrator. } -void GeolocationDispatcherHostImpl::RefreshGeolocationObserverOptions() { +void GeolocationDispatcherHostOldImpl::RefreshGeolocationObserverOptions() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (bridge_update_options_.empty()) { if (location_provider_) { @@ -221,16 +223,17 @@ void GeolocationDispatcherHostImpl::RefreshGeolocationObserverOptions() { if (!location_provider_) location_provider_ = GeolocationProvider::GetInstance(); // Re-add to re-establish our options, in case they changed. - location_provider_->AddObserver(this, - GeolocationObserverOptions::Collapse( - bridge_update_options_)); + location_provider_->AddObserver( + this, + GeolocationObserverOptions::Collapse(bridge_update_options_)); } } } // namespace -GeolocationDispatcherHost* GeolocationDispatcherHost::New( +GeolocationDispatcherHostOld* GeolocationDispatcherHostOld::New( int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context) { - return new GeolocationDispatcherHostImpl(resource_message_filter_process_id, - geolocation_permission_context); + return new GeolocationDispatcherHostOldImpl( + resource_message_filter_process_id, + geolocation_permission_context); } diff --git a/chrome/browser/geolocation/geolocation_dispatcher_host.h b/chrome/browser/geolocation/geolocation_dispatcher_host_old.h index 38b79ef..655049a 100644 --- a/chrome/browser/geolocation/geolocation_dispatcher_host.h +++ b/chrome/browser/geolocation/geolocation_dispatcher_host_old.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_ -#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_ +#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_OLD_H_ +#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_OLD_H_ #pragma once #include "base/ref_counted.h" @@ -11,13 +11,16 @@ class GeolocationPermissionContext; namespace IPC { class Message; } -// GeolocationDispatcherHost is a delegate for Geolocation messages used by +// GeolocationDispatcherHostOld is a delegate for Geolocation messages used by // ResourceMessageFilter. // It's the complement of GeolocationDispatcher (owned by RenderView). -class GeolocationDispatcherHost - : public base::RefCountedThreadSafe<GeolocationDispatcherHost> { + +// TODO(jknotten): Remove this class once the new client-based implementation is +// checked in (see http://crbug.com/59908). +class GeolocationDispatcherHostOld + : public base::RefCountedThreadSafe<GeolocationDispatcherHostOld> { public: - static GeolocationDispatcherHost* New( + static GeolocationDispatcherHostOld* New( int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context); @@ -26,11 +29,11 @@ class GeolocationDispatcherHost virtual bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok) = 0; protected: - friend class base::RefCountedThreadSafe<GeolocationDispatcherHost>; - GeolocationDispatcherHost() {} - virtual ~GeolocationDispatcherHost() {} + friend class base::RefCountedThreadSafe<GeolocationDispatcherHostOld>; + GeolocationDispatcherHostOld() {} + virtual ~GeolocationDispatcherHostOld() {} - DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHost); + DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHostOld); }; -#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_ +#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_OLD_H_ diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc index 8a71b47..7fb9aae 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.cc +++ b/chrome/browser/geolocation/geolocation_permission_context.cc @@ -11,7 +11,7 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/geolocation/geolocation_content_settings_map.h" -#include "chrome/browser/geolocation/geolocation_dispatcher_host.h" +#include "chrome/browser/geolocation/geolocation_dispatcher_host_old.h" #include "chrome/browser/geolocation/geolocation_provider.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/geolocation/geolocation_permission_context.h b/chrome/browser/geolocation/geolocation_permission_context.h index 2fc7da1..432c9a2 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.h +++ b/chrome/browser/geolocation/geolocation_permission_context.h @@ -10,7 +10,6 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" -class GeolocationDispatcherHost; class GeolocationInfoBarQueueController; class GeolocationPermissionContext; class GURL; |