| 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_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/id_map.h" | 17 #include "base/id_map.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/timer/timer.h" | 21 #include "base/timer/timer.h" |
| 22 #include "content/browser/service_worker/embedded_worker_instance.h" | 22 #include "content/browser/service_worker/embedded_worker_instance.h" |
| 23 #include "content/browser/service_worker/service_worker_mojo_event_dispatcher.h" |
| 23 #include "content/browser/service_worker/service_worker_script_cache_map.h" | 24 #include "content/browser/service_worker/service_worker_script_cache_map.h" |
| 24 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 25 #include "content/common/service_worker/service_worker_status_code.h" | 26 #include "content/common/service_worker/service_worker_status_code.h" |
| 26 #include "content/common/service_worker/service_worker_types.h" | 27 #include "content/common/service_worker/service_worker_types.h" |
| 27 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" | 28 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" |
| 28 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 29 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
| 29 | 30 |
| 30 // Windows headers will redefine SendMessage. | 31 // Windows headers will redefine SendMessage. |
| 31 #ifdef SendMessage | 32 #ifdef SendMessage |
| 32 #undef SendMessage | 33 #undef SendMessage |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 class GURL; | 36 class GURL; |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 struct WebCircularGeofencingRegion; | 39 struct WebCircularGeofencingRegion; |
| 39 } | 40 } |
| 40 | 41 |
| 41 namespace net { | 42 namespace net { |
| 42 class HttpResponseInfo; | 43 class HttpResponseInfo; |
| 43 } | 44 } |
| 44 | 45 |
| 45 namespace content { | 46 namespace content { |
| 46 | 47 |
| 47 class EmbeddedWorkerRegistry; | 48 class EmbeddedWorkerRegistry; |
| 48 class ServiceWorkerContextCore; | 49 class ServiceWorkerContextCore; |
| 50 class ServiceWorkerMojoEventDispatcher; |
| 49 class ServiceWorkerProviderHost; | 51 class ServiceWorkerProviderHost; |
| 50 class ServiceWorkerRegistration; | 52 class ServiceWorkerRegistration; |
| 51 class ServiceWorkerURLRequestJob; | 53 class ServiceWorkerURLRequestJob; |
| 52 struct NavigatorConnectClient; | 54 struct NavigatorConnectClient; |
| 53 struct PlatformNotificationData; | 55 struct PlatformNotificationData; |
| 54 struct ServiceWorkerClientInfo; | 56 struct ServiceWorkerClientInfo; |
| 55 struct ServiceWorkerVersionInfo; | 57 struct ServiceWorkerVersionInfo; |
| 56 struct TransferredMessagePort; | 58 struct TransferredMessagePort; |
| 57 | 59 |
| 58 // This class corresponds to a specific version of a ServiceWorker | 60 // This class corresponds to a specific version of a ServiceWorker |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 void OnGetClients(int request_id, | 416 void OnGetClients(int request_id, |
| 415 const ServiceWorkerClientQueryOptions& options); | 417 const ServiceWorkerClientQueryOptions& options); |
| 416 | 418 |
| 417 void OnActivateEventFinished(int request_id, | 419 void OnActivateEventFinished(int request_id, |
| 418 blink::WebServiceWorkerEventResult result); | 420 blink::WebServiceWorkerEventResult result); |
| 419 void OnInstallEventFinished(int request_id, | 421 void OnInstallEventFinished(int request_id, |
| 420 blink::WebServiceWorkerEventResult result); | 422 blink::WebServiceWorkerEventResult result); |
| 421 void OnFetchEventFinished(int request_id, | 423 void OnFetchEventFinished(int request_id, |
| 422 ServiceWorkerFetchEventResult result, | 424 ServiceWorkerFetchEventResult result, |
| 423 const ServiceWorkerResponse& response); | 425 const ServiceWorkerResponse& response); |
| 424 void OnSyncEventFinished(int request_id, | 426 void OnSyncEventFinished(int request_id, ServiceWorkerStatusCode status); |
| 425 blink::WebServiceWorkerEventResult result); | |
| 426 void OnNotificationClickEventFinished(int request_id); | 427 void OnNotificationClickEventFinished(int request_id); |
| 427 void OnPushEventFinished(int request_id, | 428 void OnPushEventFinished(int request_id, |
| 428 blink::WebServiceWorkerEventResult result); | 429 blink::WebServiceWorkerEventResult result); |
| 429 void OnGeofencingEventFinished(int request_id); | 430 void OnGeofencingEventFinished(int request_id); |
| 430 void OnCrossOriginConnectEventFinished(int request_id, | 431 void OnCrossOriginConnectEventFinished(int request_id, |
| 431 bool accept_connection); | 432 bool accept_connection); |
| 432 void OnOpenWindow(int request_id, GURL url); | 433 void OnOpenWindow(int request_id, GURL url); |
| 433 void DidOpenWindow(int request_id, | 434 void DidOpenWindow(int request_id, |
| 434 int render_process_id, | 435 int render_process_id, |
| 435 int render_frame_id); | 436 int render_frame_id); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 | 567 |
| 567 // The status when StartWorker was invoked. Used for UMA. | 568 // The status when StartWorker was invoked. Used for UMA. |
| 568 Status prestart_status_ = NEW; | 569 Status prestart_status_ = NEW; |
| 569 // If not OK, the reason that StartWorker failed. Used for | 570 // If not OK, the reason that StartWorker failed. Used for |
| 570 // running |start_callbacks_|. | 571 // running |start_callbacks_|. |
| 571 ServiceWorkerStatusCode start_worker_status_ = SERVICE_WORKER_OK; | 572 ServiceWorkerStatusCode start_worker_status_ = SERVICE_WORKER_OK; |
| 572 | 573 |
| 573 scoped_ptr<PingController> ping_controller_; | 574 scoped_ptr<PingController> ping_controller_; |
| 574 scoped_ptr<Metrics> metrics_; | 575 scoped_ptr<Metrics> metrics_; |
| 575 | 576 |
| 577 ServiceWorkerMojoEventDispatcher mojo_event_dispatcher_; |
| 578 |
| 576 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 579 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 577 | 580 |
| 578 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 581 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 579 }; | 582 }; |
| 580 | 583 |
| 581 } // namespace content | 584 } // namespace content |
| 582 | 585 |
| 583 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 586 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |