| 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 "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/common/service_worker/service_worker_status_code.h" | 10 #include "content/common/service_worker/service_worker_status_code.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const net::SSLInfo& ssl_info, | 72 const net::SSLInfo& ssl_info, |
| 73 bool fatal) OVERRIDE; | 73 bool fatal) OVERRIDE; |
| 74 virtual void OnBeforeNetworkStart(net::URLRequest* request, | 74 virtual void OnBeforeNetworkStart(net::URLRequest* request, |
| 75 bool* defer) OVERRIDE; | 75 bool* defer) OVERRIDE; |
| 76 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 76 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
| 77 virtual void OnReadCompleted(net::URLRequest* request, | 77 virtual void OnReadCompleted(net::URLRequest* request, |
| 78 int bytes_read) OVERRIDE; | 78 int bytes_read) OVERRIDE; |
| 79 | 79 |
| 80 const net::HttpResponseInfo* http_info() const; | 80 const net::HttpResponseInfo* http_info() const; |
| 81 | 81 |
| 82 void GetExtraResponseInfo(bool* was_fetched_via_service_worker, |
| 83 GURL* original_url_via_service_worker) const; |
| 84 |
| 82 protected: | 85 protected: |
| 83 virtual ~ServiceWorkerURLRequestJob(); | 86 virtual ~ServiceWorkerURLRequestJob(); |
| 84 | 87 |
| 85 private: | 88 private: |
| 86 enum ResponseType { | 89 enum ResponseType { |
| 87 NOT_DETERMINED, | 90 NOT_DETERMINED, |
| 88 FALLBACK_TO_NETWORK, | 91 FALLBACK_TO_NETWORK, |
| 89 FORWARD_TO_SERVICE_WORKER, | 92 FORWARD_TO_SERVICE_WORKER, |
| 90 }; | 93 }; |
| 91 | 94 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 114 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 117 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
| 115 | 118 |
| 116 ResponseType response_type_; | 119 ResponseType response_type_; |
| 117 bool is_started_; | 120 bool is_started_; |
| 118 | 121 |
| 119 net::HttpByteRange byte_range_; | 122 net::HttpByteRange byte_range_; |
| 120 scoped_ptr<net::HttpResponseInfo> range_response_info_; | 123 scoped_ptr<net::HttpResponseInfo> range_response_info_; |
| 121 scoped_ptr<net::HttpResponseInfo> http_response_info_; | 124 scoped_ptr<net::HttpResponseInfo> http_response_info_; |
| 122 // Headers that have not yet been committed to |http_response_info_|. | 125 // Headers that have not yet been committed to |http_response_info_|. |
| 123 scoped_refptr<net::HttpResponseHeaders> http_response_headers_; | 126 scoped_refptr<net::HttpResponseHeaders> http_response_headers_; |
| 127 GURL response_url_; |
| 124 | 128 |
| 125 // Used when response type is FORWARD_TO_SERVICE_WORKER. | 129 // Used when response type is FORWARD_TO_SERVICE_WORKER. |
| 126 scoped_ptr<ServiceWorkerFetchDispatcher> fetch_dispatcher_; | 130 scoped_ptr<ServiceWorkerFetchDispatcher> fetch_dispatcher_; |
| 127 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context_; | 131 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context_; |
| 128 scoped_ptr<net::URLRequest> blob_request_; | 132 scoped_ptr<net::URLRequest> blob_request_; |
| 129 | 133 |
| 130 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 134 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
| 131 | 135 |
| 132 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 136 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
| 133 }; | 137 }; |
| 134 | 138 |
| 135 } // namespace content | 139 } // namespace content |
| 136 | 140 |
| 137 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 141 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| OLD | NEW |