Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: content/browser/service_worker/service_worker_version.h

Issue 2534403002: [ServiceWorker] Mojofy extendable message event. (Closed)
Patch Set: Rebase only Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 size_t GetExternalRequestCountForTest() const { 409 size_t GetExternalRequestCountForTest() const {
410 return external_request_uuid_to_request_id_.size(); 410 return external_request_uuid_to_request_id_.size();
411 } 411 }
412 412
413 // Returns the amount of time left until the request with the latest 413 // Returns the amount of time left until the request with the latest
414 // expiration time expires. 414 // expiration time expires.
415 base::TimeDelta remaining_timeout() const { 415 base::TimeDelta remaining_timeout() const {
416 return max_request_expiration_time_ - tick_clock_->NowTicks(); 416 return max_request_expiration_time_ - tick_clock_->NowTicks();
417 } 417 }
418 418
419 // Callback function for simple events dispatched through mojo interface
420 // mojom::ServiceWorkerEventDispatcher, once all simple events got dispatched
421 // through mojo, OnSimpleEventResponse function could be removed.
422 void OnSimpleEventFinished(int request_id,
423 ServiceWorkerStatusCode status,
424 base::Time dispatch_event_time);
425
419 private: 426 private:
420 friend class base::RefCounted<ServiceWorkerVersion>; 427 friend class base::RefCounted<ServiceWorkerVersion>;
421 friend class ServiceWorkerMetrics; 428 friend class ServiceWorkerMetrics;
422 friend class ServiceWorkerReadFromCacheJobTest; 429 friend class ServiceWorkerReadFromCacheJobTest;
423 friend class ServiceWorkerStallInStoppingTest; 430 friend class ServiceWorkerStallInStoppingTest;
424 friend class ServiceWorkerURLRequestJobTest; 431 friend class ServiceWorkerURLRequestJobTest;
425 friend class ServiceWorkerVersionBrowserTest; 432 friend class ServiceWorkerVersionBrowserTest;
426 friend class ServiceWorkerVersionTestP; 433 friend class ServiceWorkerVersionTestP;
427 434
428 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTestP, 435 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTestP,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 588
582 // Message handlers. 589 // Message handlers.
583 590
584 // This corresponds to the spec's get(id) steps. 591 // This corresponds to the spec's get(id) steps.
585 void OnGetClient(int request_id, const std::string& client_uuid); 592 void OnGetClient(int request_id, const std::string& client_uuid);
586 593
587 // This corresponds to the spec's matchAll(options) steps. 594 // This corresponds to the spec's matchAll(options) steps.
588 void OnGetClients(int request_id, 595 void OnGetClients(int request_id,
589 const ServiceWorkerClientQueryOptions& options); 596 const ServiceWorkerClientQueryOptions& options);
590 597
598 // Receiver function of responses of simple events dispatched through chromium
599 // IPCs. This is internally the same with OnSimpleEventFinished and will be
600 // replaced with OnSimpleEventFinished after all of simple events are
601 // dispatched via mojo.
591 void OnSimpleEventResponse(int request_id, 602 void OnSimpleEventResponse(int request_id,
592 blink::WebServiceWorkerEventResult result, 603 blink::WebServiceWorkerEventResult result,
593 base::Time dispatch_event_time); 604 base::Time dispatch_event_time);
594 void OnOpenWindow(int request_id, GURL url); 605 void OnOpenWindow(int request_id, GURL url);
595 void OnOpenWindowFinished(int request_id, 606 void OnOpenWindowFinished(int request_id,
596 ServiceWorkerStatusCode status, 607 ServiceWorkerStatusCode status,
597 const ServiceWorkerClientInfo& client_info); 608 const ServiceWorkerClientInfo& client_info);
598 609
599 void OnSetCachedMetadata(const GURL& url, const std::vector<char>& data); 610 void OnSetCachedMetadata(const GURL& url, const std::vector<char>& data);
600 void OnSetCachedMetadataFinished(int64_t callback_id, int result); 611 void OnSetCachedMetadataFinished(int64_t callback_id, int result);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 850
840 // At this point |this| can have been deleted, so don't do anything other 851 // At this point |this| can have been deleted, so don't do anything other
841 // than returning. 852 // than returning.
842 853
843 return true; 854 return true;
844 } 855 }
845 856
846 } // namespace content 857 } // namespace content
847 858
848 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 859 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698