OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Accessors for the info about the appcached response, if any, | 65 // Accessors for the info about the appcached response, if any, |
66 // that this job has been instructed to deliver. These are only | 66 // that this job has been instructed to deliver. These are only |
67 // valid to call if is_delivering_appcache_response. | 67 // valid to call if is_delivering_appcache_response. |
68 const GURL& manifest_url() const { return manifest_url_; } | 68 const GURL& manifest_url() const { return manifest_url_; } |
69 int64 group_id() const { return group_id_; } | 69 int64 group_id() const { return group_id_; } |
70 int64 cache_id() const { return cache_id_; } | 70 int64 cache_id() const { return cache_id_; } |
71 const AppCacheEntry& entry() const { return entry_; } | 71 const AppCacheEntry& entry() const { return entry_; } |
72 | 72 |
73 // net::URLRequestJob's Kill method is made public so the users of this | 73 // net::URLRequestJob's Kill method is made public so the users of this |
74 // class in the appcache namespace can call it. | 74 // class in the appcache namespace can call it. |
75 virtual void Kill() OVERRIDE; | 75 virtual void Kill() override; |
76 | 76 |
77 // Returns true if the job has been started by the net library. | 77 // Returns true if the job has been started by the net library. |
78 bool has_been_started() const { | 78 bool has_been_started() const { |
79 return has_been_started_; | 79 return has_been_started_; |
80 } | 80 } |
81 | 81 |
82 // Returns true if the job has been killed. | 82 // Returns true if the job has been killed. |
83 bool has_been_killed() const { | 83 bool has_been_killed() const { |
84 return has_been_killed_; | 84 return has_been_killed_; |
85 } | 85 } |
(...skipping 28 matching lines...) Expand all Loading... |
114 // For executable response handling. | 114 // For executable response handling. |
115 void BeginExecutableHandlerDelivery(); | 115 void BeginExecutableHandlerDelivery(); |
116 void OnExecutableSourceLoaded(int result); | 116 void OnExecutableSourceLoaded(int result); |
117 void InvokeExecutableHandler(AppCacheExecutableHandler* handler); | 117 void InvokeExecutableHandler(AppCacheExecutableHandler* handler); |
118 void OnExecutableResponseCallback( | 118 void OnExecutableResponseCallback( |
119 const AppCacheExecutableHandler::Response& response); | 119 const AppCacheExecutableHandler::Response& response); |
120 void BeginErrorDelivery(const char* message); | 120 void BeginErrorDelivery(const char* message); |
121 | 121 |
122 // AppCacheStorage::Delegate methods | 122 // AppCacheStorage::Delegate methods |
123 virtual void OnResponseInfoLoaded( | 123 virtual void OnResponseInfoLoaded( |
124 AppCacheResponseInfo* response_info, int64 response_id) OVERRIDE; | 124 AppCacheResponseInfo* response_info, int64 response_id) override; |
125 virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) OVERRIDE; | 125 virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) override; |
126 | 126 |
127 const net::HttpResponseInfo* http_info() const; | 127 const net::HttpResponseInfo* http_info() const; |
128 bool is_range_request() const { return range_requested_.IsValid(); } | 128 bool is_range_request() const { return range_requested_.IsValid(); } |
129 void SetupRangeResponse(); | 129 void SetupRangeResponse(); |
130 | 130 |
131 // AppCacheResponseReader completion callback | 131 // AppCacheResponseReader completion callback |
132 void OnReadComplete(int result); | 132 void OnReadComplete(int result); |
133 | 133 |
134 // net::URLRequestJob methods, see url_request_job.h for doc comments | 134 // net::URLRequestJob methods, see url_request_job.h for doc comments |
135 virtual void Start() OVERRIDE; | 135 virtual void Start() override; |
136 virtual net::LoadState GetLoadState() const OVERRIDE; | 136 virtual net::LoadState GetLoadState() const override; |
137 virtual bool GetCharset(std::string* charset) OVERRIDE; | 137 virtual bool GetCharset(std::string* charset) override; |
138 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; | 138 virtual void GetResponseInfo(net::HttpResponseInfo* info) override; |
139 virtual bool ReadRawData(net::IOBuffer* buf, | 139 virtual bool ReadRawData(net::IOBuffer* buf, |
140 int buf_size, | 140 int buf_size, |
141 int *bytes_read) OVERRIDE; | 141 int *bytes_read) override; |
142 | 142 |
143 // Sets extra request headers for Job types that support request headers. | 143 // Sets extra request headers for Job types that support request headers. |
144 // This is how we get informed of range-requests. | 144 // This is how we get informed of range-requests. |
145 virtual void SetExtraRequestHeaders( | 145 virtual void SetExtraRequestHeaders( |
146 const net::HttpRequestHeaders& headers) OVERRIDE; | 146 const net::HttpRequestHeaders& headers) override; |
147 | 147 |
148 // FilterContext methods | 148 // FilterContext methods |
149 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 149 virtual bool GetMimeType(std::string* mime_type) const override; |
150 virtual int GetResponseCode() const OVERRIDE; | 150 virtual int GetResponseCode() const override; |
151 | 151 |
152 AppCacheHost* host_; | 152 AppCacheHost* host_; |
153 AppCacheStorage* storage_; | 153 AppCacheStorage* storage_; |
154 base::TimeTicks start_time_tick_; | 154 base::TimeTicks start_time_tick_; |
155 bool has_been_started_; | 155 bool has_been_started_; |
156 bool has_been_killed_; | 156 bool has_been_killed_; |
157 DeliveryType delivery_type_; | 157 DeliveryType delivery_type_; |
158 GURL manifest_url_; | 158 GURL manifest_url_; |
159 int64 group_id_; | 159 int64 group_id_; |
160 int64 cache_id_; | 160 int64 cache_id_; |
161 AppCacheEntry entry_; | 161 AppCacheEntry entry_; |
162 bool is_fallback_; | 162 bool is_fallback_; |
163 bool is_main_resource_; // Used for histogram logging. | 163 bool is_main_resource_; // Used for histogram logging. |
164 bool cache_entry_not_found_; | 164 bool cache_entry_not_found_; |
165 scoped_refptr<AppCacheResponseInfo> info_; | 165 scoped_refptr<AppCacheResponseInfo> info_; |
166 scoped_refptr<net::GrowableIOBuffer> handler_source_buffer_; | 166 scoped_refptr<net::GrowableIOBuffer> handler_source_buffer_; |
167 scoped_ptr<AppCacheResponseReader> handler_source_reader_; | 167 scoped_ptr<AppCacheResponseReader> handler_source_reader_; |
168 net::HttpByteRange range_requested_; | 168 net::HttpByteRange range_requested_; |
169 scoped_ptr<net::HttpResponseInfo> range_response_info_; | 169 scoped_ptr<net::HttpResponseInfo> range_response_info_; |
170 scoped_ptr<AppCacheResponseReader> reader_; | 170 scoped_ptr<AppCacheResponseReader> reader_; |
171 scoped_refptr<AppCache> cache_; | 171 scoped_refptr<AppCache> cache_; |
172 scoped_refptr<AppCacheGroup> group_; | 172 scoped_refptr<AppCacheGroup> group_; |
173 base::WeakPtrFactory<AppCacheURLRequestJob> weak_factory_; | 173 base::WeakPtrFactory<AppCacheURLRequestJob> weak_factory_; |
174 }; | 174 }; |
175 | 175 |
176 } // namespace content | 176 } // namespace content |
177 | 177 |
178 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ | 178 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ |
OLD | NEW |