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

Side by Side Diff: content/browser/geofencing/geofencing_dispatcher_host.h

Issue 623823002: Chrome side of passing on the service worker registration with geofencing API calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
7 7
8 #include "content/common/geofencing_status.h" 8 #include "content/common/geofencing_status.h"
9 #include "content/public/browser/browser_message_filter.h" 9 #include "content/public/browser/browser_message_filter.h"
10 10
11 namespace blink { 11 namespace blink {
12 struct WebCircularGeofencingRegion; 12 struct WebCircularGeofencingRegion;
13 } 13 }
14 14
15 namespace content { 15 namespace content {
16 16
17 class BrowserContext; 17 class BrowserContext;
18 class ServiceWorkerDispatcherHost;
18 19
19 class GeofencingDispatcherHost : public BrowserMessageFilter { 20 class GeofencingDispatcherHost : public BrowserMessageFilter {
20 public: 21 public:
21 explicit GeofencingDispatcherHost(BrowserContext* browser_context); 22 GeofencingDispatcherHost(
23 BrowserContext* browser_context,
24 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter);
22 25
23 private: 26 private:
24 virtual ~GeofencingDispatcherHost(); 27 virtual ~GeofencingDispatcherHost();
25 28
26 // BrowserMessageFilter implementation. 29 // BrowserMessageFilter implementation.
27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
28 31
29 void OnRegisterRegion(int thread_id, 32 void OnRegisterRegion(int thread_id,
30 int request_id, 33 int request_id,
31 const std::string& region_id, 34 const std::string& region_id,
32 const blink::WebCircularGeofencingRegion& region); 35 const blink::WebCircularGeofencingRegion& region,
36 int service_worker_registration_handle_id);
33 void OnUnregisterRegion(int thread_id, 37 void OnUnregisterRegion(int thread_id,
34 int request_id, 38 int request_id,
35 const std::string& region_id); 39 const std::string& region_id,
36 void OnGetRegisteredRegions(int thread_id, int request_id); 40 int service_worker_registration_handle_id);
41 void OnGetRegisteredRegions(int thread_id,
42 int request_id,
43 int service_worker_registration_handle_id);
37 44
38 void RegisterRegionCompleted(int thread_id, 45 void RegisterRegionCompleted(int thread_id,
39 int request_id, 46 int request_id,
40 GeofencingStatus result); 47 GeofencingStatus result);
41 void UnregisterRegionCompleted(int thread_id, 48 void UnregisterRegionCompleted(int thread_id,
42 int request_id, 49 int request_id,
43 GeofencingStatus result); 50 GeofencingStatus result);
44 51
45 BrowserContext* browser_context_; 52 BrowserContext* browser_context_;
53 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter_;
Michael van Ouwerkerk 2014/10/09 12:28:09 It seems strange for one filter to have a pointer
Marijn Kruisselbrink 2014/10/09 22:28:58 That's the question, yes.
46 base::WeakPtrFactory<GeofencingDispatcherHost> weak_factory_; 54 base::WeakPtrFactory<GeofencingDispatcherHost> weak_factory_;
47 55
48 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost); 56 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost);
49 }; 57 };
50 58
51 } // namespace content 59 } // namespace content
52 60
53 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ 61 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698