| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 
| 7 | 7 | 
|  | 8 #include "base/memory/weak_ptr.h" | 
| 8 #include "content/public/browser/browser_message_filter.h" | 9 #include "content/public/browser/browser_message_filter.h" | 
| 9 | 10 | 
| 10 class GURL; | 11 class GURL; | 
| 11 | 12 | 
| 12 namespace content { | 13 namespace content { | 
| 13 | 14 | 
| 14 class ServiceWorkerContext; | 15 class ServiceWorkerContextCore; | 
|  | 16 class ServiceWorkerContextWrapper; | 
| 15 | 17 | 
| 16 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 18 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 
| 17  public: | 19  public: | 
| 18   ServiceWorkerDispatcherHost(int render_process_id, | 20   explicit ServiceWorkerDispatcherHost(int render_process_id); | 
| 19                               ServiceWorkerContext* context); | 21 | 
|  | 22   void Init(ServiceWorkerContextWrapper* context_wrapper); | 
| 20 | 23 | 
| 21   // BrowserIOMessageFilter implementation | 24   // BrowserIOMessageFilter implementation | 
| 22   virtual bool OnMessageReceived(const IPC::Message& message, | 25   virtual bool OnMessageReceived(const IPC::Message& message, | 
| 23                                  bool* message_was_ok) OVERRIDE; | 26                                  bool* message_was_ok) OVERRIDE; | 
| 24 | 27 | 
| 25  protected: | 28  protected: | 
| 26   virtual ~ServiceWorkerDispatcherHost(); | 29   virtual ~ServiceWorkerDispatcherHost(); | 
| 27 | 30 | 
| 28  private: | 31  private: | 
|  | 32   friend class TestingServiceWorkerDispatcherHost; | 
|  | 33 | 
| 29   // IPC Message handlers | 34   // IPC Message handlers | 
| 30   void OnRegisterServiceWorker(int32 thread_id, | 35   void OnRegisterServiceWorker(int32 thread_id, | 
| 31                                int32 request_id, | 36                                int32 request_id, | 
| 32                                const GURL& scope, | 37                                const GURL& scope, | 
| 33                                const GURL& script_url); | 38                                const GURL& script_url); | 
| 34   void OnUnregisterServiceWorker(int32 thread_id, | 39   void OnUnregisterServiceWorker(int32 thread_id, | 
| 35                                  int32 request_id, | 40                                  int32 request_id, | 
| 36                                  const GURL& scope); | 41                                  const GURL& scope); | 
| 37   scoped_refptr<ServiceWorkerContext> context_; | 42 | 
|  | 43   base::WeakPtr<ServiceWorkerContextCore> context_; | 
| 38 }; | 44 }; | 
| 39 | 45 | 
| 40 }  // namespace content | 46 }  // namespace content | 
| 41 | 47 | 
| 42 #endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 48 #endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 
| OLD | NEW | 
|---|