OLD | NEW |
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_URL_REQUEST_JOB_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 void ForwardToServiceWorker(); | 52 void ForwardToServiceWorker(); |
53 | 53 |
54 bool ShouldFallbackToNetwork() const { | 54 bool ShouldFallbackToNetwork() const { |
55 return response_type_ == FALLBACK_TO_NETWORK; | 55 return response_type_ == FALLBACK_TO_NETWORK; |
56 } | 56 } |
57 bool ShouldForwardToServiceWorker() const { | 57 bool ShouldForwardToServiceWorker() const { |
58 return response_type_ == FORWARD_TO_SERVICE_WORKER; | 58 return response_type_ == FORWARD_TO_SERVICE_WORKER; |
59 } | 59 } |
60 | 60 |
61 // net::URLRequestJob overrides: | 61 // net::URLRequestJob overrides: |
62 virtual void Start() OVERRIDE; | 62 virtual void Start() override; |
63 virtual void Kill() OVERRIDE; | 63 virtual void Kill() override; |
64 virtual net::LoadState GetLoadState() const OVERRIDE; | 64 virtual net::LoadState GetLoadState() const override; |
65 virtual bool GetCharset(std::string* charset) OVERRIDE; | 65 virtual bool GetCharset(std::string* charset) override; |
66 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 66 virtual bool GetMimeType(std::string* mime_type) const override; |
67 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; | 67 virtual void GetResponseInfo(net::HttpResponseInfo* info) override; |
68 virtual void GetLoadTimingInfo( | 68 virtual void GetLoadTimingInfo( |
69 net::LoadTimingInfo* load_timing_info) const OVERRIDE; | 69 net::LoadTimingInfo* load_timing_info) const override; |
70 virtual int GetResponseCode() const OVERRIDE; | 70 virtual int GetResponseCode() const override; |
71 virtual void SetExtraRequestHeaders( | 71 virtual void SetExtraRequestHeaders( |
72 const net::HttpRequestHeaders& headers) OVERRIDE; | 72 const net::HttpRequestHeaders& headers) override; |
73 virtual bool ReadRawData(net::IOBuffer* buf, | 73 virtual bool ReadRawData(net::IOBuffer* buf, |
74 int buf_size, | 74 int buf_size, |
75 int *bytes_read) OVERRIDE; | 75 int *bytes_read) override; |
76 | 76 |
77 // net::URLRequest::Delegate overrides that read the blob from the | 77 // net::URLRequest::Delegate overrides that read the blob from the |
78 // ServiceWorkerFetchResponse. | 78 // ServiceWorkerFetchResponse. |
79 virtual void OnReceivedRedirect(net::URLRequest* request, | 79 virtual void OnReceivedRedirect(net::URLRequest* request, |
80 const net::RedirectInfo& redirect_info, | 80 const net::RedirectInfo& redirect_info, |
81 bool* defer_redirect) OVERRIDE; | 81 bool* defer_redirect) override; |
82 virtual void OnAuthRequired(net::URLRequest* request, | 82 virtual void OnAuthRequired(net::URLRequest* request, |
83 net::AuthChallengeInfo* auth_info) OVERRIDE; | 83 net::AuthChallengeInfo* auth_info) override; |
84 virtual void OnCertificateRequested( | 84 virtual void OnCertificateRequested( |
85 net::URLRequest* request, | 85 net::URLRequest* request, |
86 net::SSLCertRequestInfo* cert_request_info) OVERRIDE; | 86 net::SSLCertRequestInfo* cert_request_info) override; |
87 virtual void OnSSLCertificateError(net::URLRequest* request, | 87 virtual void OnSSLCertificateError(net::URLRequest* request, |
88 const net::SSLInfo& ssl_info, | 88 const net::SSLInfo& ssl_info, |
89 bool fatal) OVERRIDE; | 89 bool fatal) override; |
90 virtual void OnBeforeNetworkStart(net::URLRequest* request, | 90 virtual void OnBeforeNetworkStart(net::URLRequest* request, |
91 bool* defer) OVERRIDE; | 91 bool* defer) override; |
92 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 92 virtual void OnResponseStarted(net::URLRequest* request) override; |
93 virtual void OnReadCompleted(net::URLRequest* request, | 93 virtual void OnReadCompleted(net::URLRequest* request, |
94 int bytes_read) OVERRIDE; | 94 int bytes_read) override; |
95 | 95 |
96 const net::HttpResponseInfo* http_info() const; | 96 const net::HttpResponseInfo* http_info() const; |
97 | 97 |
98 void GetExtraResponseInfo(bool* was_fetched_via_service_worker, | 98 void GetExtraResponseInfo(bool* was_fetched_via_service_worker, |
99 bool* was_fallback_required_by_service_worker, | 99 bool* was_fallback_required_by_service_worker, |
100 GURL* original_url_via_service_worker, | 100 GURL* original_url_via_service_worker, |
101 base::TimeTicks* fetch_start_time, | 101 base::TimeTicks* fetch_start_time, |
102 base::TimeTicks* fetch_ready_time, | 102 base::TimeTicks* fetch_ready_time, |
103 base::TimeTicks* fetch_end_time) const; | 103 base::TimeTicks* fetch_end_time) const; |
104 | 104 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; | 177 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; |
178 | 178 |
179 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 179 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 181 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
182 }; | 182 }; |
183 | 183 |
184 } // namespace content | 184 } // namespace content |
185 | 185 |
186 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 186 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |