| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/optional.h" | 16 #include "base/optional.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "content/browser/service_worker/service_worker_registration_status.h" | 18 #include "content/browser/service_worker/service_worker_registration_status.h" |
| 19 #include "content/common/service_worker/service_worker.mojom.h" | 19 #include "content/common/service_worker/service_worker.mojom.h" |
| 20 #include "content/common/service_worker/service_worker_types.h" | 20 #include "content/common/service_worker/service_worker_types.h" |
| 21 #include "content/public/browser/browser_message_filter.h" | 21 #include "content/public/browser/browser_message_filter.h" |
| 22 #include "mojo/public/cpp/bindings/associated_binding_set.h" | 22 #include "mojo/public/cpp/bindings/associated_binding_set.h" |
| 23 #include "mojo/public/cpp/bindings/strong_associated_binding_set.h" |
| 23 | 24 |
| 24 class GURL; | 25 class GURL; |
| 25 | 26 |
| 26 namespace url { | 27 namespace url { |
| 27 class Origin; | 28 class Origin; |
| 28 } // namespace url | 29 } // namespace url |
| 29 | 30 |
| 30 namespace content { | 31 namespace content { |
| 31 | 32 |
| 32 class MessagePort; | 33 class MessagePort; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 47 // content::ServiceWorkerDispatcherHost. This can be overridden only for | 48 // content::ServiceWorkerDispatcherHost. This can be overridden only for |
| 48 // testing. | 49 // testing. |
| 49 class CONTENT_EXPORT ServiceWorkerDispatcherHost | 50 class CONTENT_EXPORT ServiceWorkerDispatcherHost |
| 50 : public mojom::ServiceWorkerDispatcherHost, | 51 : public mojom::ServiceWorkerDispatcherHost, |
| 51 public BrowserMessageFilter { | 52 public BrowserMessageFilter { |
| 52 public: | 53 public: |
| 53 ServiceWorkerDispatcherHost( | 54 ServiceWorkerDispatcherHost( |
| 54 int render_process_id, | 55 int render_process_id, |
| 55 ResourceContext* resource_context); | 56 ResourceContext* resource_context); |
| 56 | 57 |
| 58 // |blob_storage_context| and |loader_factory_getter| are used only |
| 59 // if IsServicificationEnabled is true. |
| 57 void Init(ServiceWorkerContextWrapper* context_wrapper); | 60 void Init(ServiceWorkerContextWrapper* context_wrapper); |
| 58 | 61 |
| 59 // BrowserMessageFilter implementation | 62 // BrowserMessageFilter implementation |
| 60 void OnFilterAdded(IPC::Channel* channel) override; | 63 void OnFilterAdded(IPC::Channel* channel) override; |
| 61 void OnFilterRemoved() override; | 64 void OnFilterRemoved() override; |
| 62 void OnDestruct() const override; | 65 void OnDestruct() const override; |
| 63 bool OnMessageReceived(const IPC::Message& message) override; | 66 bool OnMessageReceived(const IPC::Message& message) override; |
| 64 | 67 |
| 65 // IPC::Sender implementation | 68 // IPC::Sender implementation |
| 66 | 69 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 mojo::AssociatedBindingSet<mojom::ServiceWorkerDispatcherHost> bindings_; | 280 mojo::AssociatedBindingSet<mojom::ServiceWorkerDispatcherHost> bindings_; |
| 278 | 281 |
| 279 base::WeakPtrFactory<ServiceWorkerDispatcherHost> weak_factory_; | 282 base::WeakPtrFactory<ServiceWorkerDispatcherHost> weak_factory_; |
| 280 | 283 |
| 281 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 284 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
| 282 }; | 285 }; |
| 283 | 286 |
| 284 } // namespace content | 287 } // namespace content |
| 285 | 288 |
| 286 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 289 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
| OLD | NEW |