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

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

Issue 1146253004: Add workerReady timing for ServiceWorker controlled requests [2/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CONTROLLEE_REQUEST_HANDLER _H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER _H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER _H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER _H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "content/browser/service_worker/service_worker_request_handler.h" 9 #include "content/browser/service_worker/service_worker_request_handler.h"
10 #include "content/common/service_worker/service_worker_types.h" 10 #include "content/common/service_worker/service_worker_types.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 RequestContextFrameType frame_type, 42 RequestContextFrameType frame_type,
43 scoped_refptr<ResourceRequestBody> body); 43 scoped_refptr<ResourceRequestBody> body);
44 ~ServiceWorkerControlleeRequestHandler() override; 44 ~ServiceWorkerControlleeRequestHandler() override;
45 45
46 // Called via custom URLRequestJobFactory. 46 // Called via custom URLRequestJobFactory.
47 net::URLRequestJob* MaybeCreateJob( 47 net::URLRequestJob* MaybeCreateJob(
48 net::URLRequest* request, 48 net::URLRequest* request,
49 net::NetworkDelegate* network_delegate, 49 net::NetworkDelegate* network_delegate,
50 ResourceContext* resource_context) override; 50 ResourceContext* resource_context) override;
51 51
52 void GetExtraResponseInfo( 52 void GetExtraResponseInfo(ResourceResponseInfo* response_info) const override;
53 bool* was_fetched_via_service_worker,
54 bool* was_fallback_required_by_service_worker,
55 GURL* original_url_via_service_worker,
56 blink::WebServiceWorkerResponseType* response_type_via_service_worker,
57 base::TimeTicks* worker_start_time) const override;
58 53
59 private: 54 private:
60 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, 55 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest,
61 ActivateWaitingVersion); 56 ActivateWaitingVersion);
62 typedef ServiceWorkerControlleeRequestHandler self; 57 typedef ServiceWorkerControlleeRequestHandler self;
63 58
64 // For main resource case. 59 // For main resource case.
65 void PrepareForMainResource(const net::URLRequest* request); 60 void PrepareForMainResource(const net::URLRequest* request);
66 void DidLookupRegistrationForMainResource( 61 void DidLookupRegistrationForMainResource(
67 ServiceWorkerStatusCode status, 62 ServiceWorkerStatusCode status,
68 const scoped_refptr<ServiceWorkerRegistration>& registration); 63 const scoped_refptr<ServiceWorkerRegistration>& registration);
69 void OnVersionStatusChanged( 64 void OnVersionStatusChanged(
70 ServiceWorkerRegistration* registration, 65 ServiceWorkerRegistration* registration,
71 ServiceWorkerVersion* version); 66 ServiceWorkerVersion* version);
72 67
73 // For sub resource case. 68 // For sub resource case.
74 void PrepareForSubResource(); 69 void PrepareForSubResource();
75 70
76 bool is_main_resource_load_; 71 bool is_main_resource_load_;
77 scoped_refptr<ServiceWorkerURLRequestJob> job_; 72 scoped_refptr<ServiceWorkerURLRequestJob> job_;
78 FetchRequestMode request_mode_; 73 FetchRequestMode request_mode_;
79 FetchCredentialsMode credentials_mode_; 74 FetchCredentialsMode credentials_mode_;
80 RequestContextType request_context_type_; 75 RequestContextType request_context_type_;
81 RequestContextFrameType frame_type_; 76 RequestContextFrameType frame_type_;
82 scoped_refptr<ResourceRequestBody> body_; 77 scoped_refptr<ResourceRequestBody> body_;
83 ResourceContext* resource_context_; 78 ResourceContext* resource_context_;
84 GURL stripped_url_; 79 GURL stripped_url_;
85 base::TimeTicks worker_start_time_; 80 base::TimeTicks worker_start_time_;
81 base::TimeTicks worker_ready_time_;
86 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; 82 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_;
87 83
88 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); 84 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler);
89 }; 85 };
90 86
91 } // namespace content 87 } // namespace content
92 88
93 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND LER_H_ 89 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND LER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698