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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <functional> | 10 #include <functional> |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 | 399 |
400 // Returns true if the service worker has work to do: it has pending | 400 // Returns true if the service worker has work to do: it has pending |
401 // requests, in-progress streaming URLRequestJobs, or pending start callbacks. | 401 // requests, in-progress streaming URLRequestJobs, or pending start callbacks. |
402 bool HasWork() const; | 402 bool HasWork() const; |
403 | 403 |
404 // Returns the number of pending external request count of this worker. | 404 // Returns the number of pending external request count of this worker. |
405 size_t GetExternalRequestCountForTest() const { | 405 size_t GetExternalRequestCountForTest() const { |
406 return external_request_uuid_to_request_id_.size(); | 406 return external_request_uuid_to_request_id_.size(); |
407 } | 407 } |
408 | 408 |
409 // Callback function for simple events dispatched through mojo interface | |
410 // mojom::ServiceWorkerEventDispatcher, once all simple events got dispatched | |
411 // through mojo, |OnSimpleEventResponse| function could be removed. | |
shimazu
2016/12/05 03:40:21
Could you remove the vertical bars '|' from the me
leonhsl(Using Gerrit)
2016/12/06 08:54:38
Done.
| |
412 void OnSimpleEventFinished(int request_id, | |
413 ServiceWorkerStatusCode status, | |
414 base::Time dispatch_event_time); | |
415 | |
409 private: | 416 private: |
410 friend class base::RefCounted<ServiceWorkerVersion>; | 417 friend class base::RefCounted<ServiceWorkerVersion>; |
411 friend class ServiceWorkerMetrics; | 418 friend class ServiceWorkerMetrics; |
412 friend class ServiceWorkerReadFromCacheJobTest; | 419 friend class ServiceWorkerReadFromCacheJobTest; |
413 friend class ServiceWorkerStallInStoppingTest; | 420 friend class ServiceWorkerStallInStoppingTest; |
414 friend class ServiceWorkerURLRequestJobTest; | 421 friend class ServiceWorkerURLRequestJobTest; |
415 friend class ServiceWorkerVersionBrowserTest; | 422 friend class ServiceWorkerVersionBrowserTest; |
416 friend class ServiceWorkerVersionTestP; | 423 friend class ServiceWorkerVersionTestP; |
417 | 424 |
418 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTestP, | 425 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTestP, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 | 616 |
610 // Message handlers. | 617 // Message handlers. |
611 | 618 |
612 // This corresponds to the spec's get(id) steps. | 619 // This corresponds to the spec's get(id) steps. |
613 void OnGetClient(int request_id, const std::string& client_uuid); | 620 void OnGetClient(int request_id, const std::string& client_uuid); |
614 | 621 |
615 // This corresponds to the spec's matchAll(options) steps. | 622 // This corresponds to the spec's matchAll(options) steps. |
616 void OnGetClients(int request_id, | 623 void OnGetClients(int request_id, |
617 const ServiceWorkerClientQueryOptions& options); | 624 const ServiceWorkerClientQueryOptions& options); |
618 | 625 |
619 void OnSimpleEventResponse(int request_id, | 626 void OnSimpleEventResponse(int request_id, |
shimazu
2016/12/05 03:40:21
How about adding a comment like
"Receiver function
leonhsl(Using Gerrit)
2016/12/06 08:54:38
Done and thanks!
| |
620 blink::WebServiceWorkerEventResult result, | 627 blink::WebServiceWorkerEventResult result, |
621 base::Time dispatch_event_time); | 628 base::Time dispatch_event_time); |
622 void OnOpenWindow(int request_id, GURL url); | 629 void OnOpenWindow(int request_id, GURL url); |
623 void OnOpenWindowFinished(int request_id, | 630 void OnOpenWindowFinished(int request_id, |
624 ServiceWorkerStatusCode status, | 631 ServiceWorkerStatusCode status, |
625 const ServiceWorkerClientInfo& client_info); | 632 const ServiceWorkerClientInfo& client_info); |
626 | 633 |
627 void OnSetCachedMetadata(const GURL& url, const std::vector<char>& data); | 634 void OnSetCachedMetadata(const GURL& url, const std::vector<char>& data); |
628 void OnSetCachedMetadataFinished(int64_t callback_id, int result); | 635 void OnSetCachedMetadataFinished(int64_t callback_id, int result); |
629 void OnClearCachedMetadata(const GURL& url); | 636 void OnClearCachedMetadata(const GURL& url); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 | 869 |
863 // At this point |this| can have been deleted, so don't do anything other | 870 // At this point |this| can have been deleted, so don't do anything other |
864 // than returning. | 871 // than returning. |
865 | 872 |
866 return true; | 873 return true; |
867 } | 874 } |
868 | 875 |
869 } // namespace content | 876 } // namespace content |
870 | 877 |
871 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 878 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |