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

Unified Diff: trunk/src/content/browser/geolocation/geolocation_dispatcher_host.h

Issue 265043004: Revert 267948 "Merge GeolocationDispatcherHostImpl with Geolocat..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | trunk/src/content/browser/geolocation/geolocation_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/browser/geolocation/geolocation_dispatcher_host.h
===================================================================
--- trunk/src/content/browser/geolocation/geolocation_dispatcher_host.h (revision 267948)
+++ trunk/src/content/browser/geolocation/geolocation_dispatcher_host.h (working copy)
@@ -5,14 +5,8 @@
#ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_
-#include <map>
-#include <set>
-
-#include "content/browser/geolocation/geolocation_provider_impl.h"
#include "content/public/browser/browser_message_filter.h"
-class GURL;
-
namespace content {
class GeolocationPermissionContext;
@@ -21,70 +15,21 @@
// It's the complement of GeolocationDispatcher (owned by RenderView).
class GeolocationDispatcherHost : public BrowserMessageFilter {
public:
- GeolocationDispatcherHost(
+ static GeolocationDispatcherHost* New(
int render_process_id,
GeolocationPermissionContext* geolocation_permission_context);
- virtual ~GeolocationDispatcherHost();
// Pause or resumes geolocation for the given |render_view_id|. Should
// be called on the IO thread. Resuming when nothing is paused is a no-op.
// If a renderer is paused while not currently using geolocation but
// then goes on to do so before being resumed, then that renderer will
// not get geolocation updates until it is resumed.
- void PauseOrResume(int render_view_id, bool should_pause);
+ virtual void PauseOrResume(int render_view_id, bool should_pause) = 0;
- private:
- // GeolocationDispatcherHost
- virtual bool OnMessageReceived(const IPC::Message& msg,
- bool* msg_was_ok) OVERRIDE;
+ protected:
+ GeolocationDispatcherHost();
+ virtual ~GeolocationDispatcherHost();
- // Message handlers:
- void OnRequestPermission(int render_view_id,
- int bridge_id,
- const GURL& requesting_frame,
- bool user_gesture);
- void OnCancelPermissionRequest(int render_view_id,
- int bridge_id,
- const GURL& requesting_frame);
- void OnStartUpdating(int render_view_id,
- const GURL& requesting_frame,
- bool enable_high_accuracy);
- void OnStopUpdating(int render_view_id);
-
- // Updates the |geolocation_provider_| with the currently required update
- // options.
- void RefreshGeolocationOptions();
-
- void OnLocationUpdate(const Geoposition& position);
-
- int render_process_id_;
- scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_;
-
- struct RendererGeolocationOptions {
- bool high_accuracy;
- bool is_paused;
- };
-
- // Used to keep track of the renderers in this process that are using
- // geolocation and the options associated with them. The map is iterated
- // when a location update is available and the fan out to individual bridge
- // IDs happens renderer side, in order to minimize context switches.
- // Only used on the IO thread.
- std::map<int, RendererGeolocationOptions> geolocation_renderers_;
-
- // Used by Android WebView to support that case that a renderer is in the
- // 'paused' state but not yet using geolocation. If the renderer does start
- // using geolocation while paused, we move from this set into
- // |geolocation_renderers_|. If the renderer doesn't end up wanting to use
- // geolocation while 'paused' then we remove from this set. A renderer id
- // can exist only in this set or |geolocation_renderers_|, never both.
- std::set<int> pending_paused_geolocation_renderers_;
-
- // Only set whilst we are registered with the geolocation provider.
- GeolocationProviderImpl* geolocation_provider_;
-
- GeolocationProviderImpl::LocationUpdateCallback callback_;
-
DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHost);
};
« no previous file with comments | « no previous file | trunk/src/content/browser/geolocation/geolocation_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698