| 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 <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 void DispatchInstallEventAfterStartWorker(const StatusCallback& callback); | 338 void DispatchInstallEventAfterStartWorker(const StatusCallback& callback); |
| 339 void DispatchActivateEventAfterStartWorker(const StatusCallback& callback); | 339 void DispatchActivateEventAfterStartWorker(const StatusCallback& callback); |
| 340 | 340 |
| 341 void DispatchMessageEventInternal( | 341 void DispatchMessageEventInternal( |
| 342 const base::string16& message, | 342 const base::string16& message, |
| 343 const std::vector<TransferredMessagePort>& sent_message_ports, | 343 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 344 const StatusCallback& callback); | 344 const StatusCallback& callback); |
| 345 | 345 |
| 346 // Message handlers. | 346 // Message handlers. |
| 347 void OnGetClientDocuments(int request_id); | 347 void OnGetClients(int request_id, |
| 348 const ServiceWorkerClientQueryOptions& options); |
| 348 void OnActivateEventFinished(int request_id, | 349 void OnActivateEventFinished(int request_id, |
| 349 blink::WebServiceWorkerEventResult result); | 350 blink::WebServiceWorkerEventResult result); |
| 350 void OnInstallEventFinished(int request_id, | 351 void OnInstallEventFinished(int request_id, |
| 351 blink::WebServiceWorkerEventResult result); | 352 blink::WebServiceWorkerEventResult result); |
| 352 void OnFetchEventFinished(int request_id, | 353 void OnFetchEventFinished(int request_id, |
| 353 ServiceWorkerFetchEventResult result, | 354 ServiceWorkerFetchEventResult result, |
| 354 const ServiceWorkerResponse& response); | 355 const ServiceWorkerResponse& response); |
| 355 void OnSyncEventFinished(int request_id); | 356 void OnSyncEventFinished(int request_id); |
| 356 void OnNotificationClickEventFinished(int request_id); | 357 void OnNotificationClickEventFinished(int request_id); |
| 357 void OnPushEventFinished(int request_id, | 358 void OnPushEventFinished(int request_id, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 380 void OnSkipWaiting(int request_id); | 381 void OnSkipWaiting(int request_id); |
| 381 void OnClaimClients(int request_id); | 382 void OnClaimClients(int request_id); |
| 382 void OnPongFromWorker(); | 383 void OnPongFromWorker(); |
| 383 | 384 |
| 384 void OnFocusClientFinished(int request_id, | 385 void OnFocusClientFinished(int request_id, |
| 385 int client_id, | 386 int client_id, |
| 386 const ServiceWorkerClientInfo& client); | 387 const ServiceWorkerClientInfo& client); |
| 387 | 388 |
| 388 void DidSkipWaiting(int request_id); | 389 void DidSkipWaiting(int request_id); |
| 389 void DidClaimClients(int request_id, ServiceWorkerStatusCode status); | 390 void DidClaimClients(int request_id, ServiceWorkerStatusCode status); |
| 390 void DidGetClientDocuments( | 391 void DidGetClients( |
| 391 int request_id, const std::vector<ServiceWorkerClientInfo>& clients); | 392 int request_id, const std::vector<ServiceWorkerClientInfo>& clients); |
| 392 | 393 |
| 393 // The timeout timer periodically calls OnTimeoutTimer, which stops the worker | 394 // The timeout timer periodically calls OnTimeoutTimer, which stops the worker |
| 394 // if it is excessively idle or unresponsive to ping. | 395 // if it is excessively idle or unresponsive to ping. |
| 395 void StartTimeoutTimer(); | 396 void StartTimeoutTimer(); |
| 396 void StopTimeoutTimer(); | 397 void StopTimeoutTimer(); |
| 397 void OnTimeoutTimer(); | 398 void OnTimeoutTimer(); |
| 398 | 399 |
| 399 // The ping protocol is for terminating workers that are taking excessively | 400 // The ping protocol is for terminating workers that are taking excessively |
| 400 // long executing JavaScript (e.g., stuck in while(true) {}). Periodically a | 401 // long executing JavaScript (e.g., stuck in while(true) {}). Periodically a |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; | 476 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; |
| 476 | 477 |
| 477 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 478 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 478 | 479 |
| 479 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 480 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 480 }; | 481 }; |
| 481 | 482 |
| 482 } // namespace content | 483 } // namespace content |
| 483 | 484 |
| 484 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 485 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |