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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "webkit/appcache/appcache_url_request_job.h" | 7 #include "webkit/appcache/appcache_url_request_job.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
16 #include "net/base/net_log.h" | 16 #include "net/base/net_log.h" |
17 #include "net/http/http_request_headers.h" | 17 #include "net/http/http_request_headers.h" |
18 #include "net/http/http_response_headers.h" | 18 #include "net/http/http_response_headers.h" |
19 #include "net/http/http_util.h" | 19 #include "net/http/http_util.h" |
20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
| 21 #include "net/url_request/url_request_context.h" |
21 #include "net/url_request/url_request_status.h" | 22 #include "net/url_request/url_request_status.h" |
22 #include "webkit/appcache/appcache_service.h" | 23 #include "webkit/appcache/appcache_service.h" |
23 | 24 |
24 namespace appcache { | 25 namespace appcache { |
25 | 26 |
26 AppCacheURLRequestJob::AppCacheURLRequestJob( | 27 AppCacheURLRequestJob::AppCacheURLRequestJob( |
27 net::URLRequest* request, AppCacheStorage* storage) | 28 net::URLRequest* request, AppCacheStorage* storage) |
28 : net::URLRequestJob(request), storage_(storage), | 29 : net::URLRequestJob(request, request->context()->network_delegate()), |
| 30 storage_(storage), |
29 has_been_started_(false), has_been_killed_(false), | 31 has_been_started_(false), has_been_killed_(false), |
30 delivery_type_(AWAITING_DELIVERY_ORDERS), | 32 delivery_type_(AWAITING_DELIVERY_ORDERS), |
31 group_id_(0), cache_id_(kNoCacheId), is_fallback_(false), | 33 group_id_(0), cache_id_(kNoCacheId), is_fallback_(false), |
32 cache_entry_not_found_(false), | 34 cache_entry_not_found_(false), |
33 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 35 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
34 DCHECK(storage_); | 36 DCHECK(storage_); |
35 } | 37 } |
36 | 38 |
37 void AppCacheURLRequestJob::DeliverAppCachedResponse( | 39 void AppCacheURLRequestJob::DeliverAppCachedResponse( |
38 const GURL& manifest_url, int64 group_id, int64 cache_id, | 40 const GURL& manifest_url, int64 group_id, int64 cache_id, |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 return; | 285 return; |
284 } | 286 } |
285 | 287 |
286 // If multiple ranges are requested, we play dumb and | 288 // If multiple ranges are requested, we play dumb and |
287 // return the entire response with 200 OK. | 289 // return the entire response with 200 OK. |
288 if (ranges.size() == 1U) | 290 if (ranges.size() == 1U) |
289 range_requested_ = ranges[0]; | 291 range_requested_ = ranges[0]; |
290 } | 292 } |
291 | 293 |
292 } // namespace appcache | 294 } // namespace appcache |
OLD | NEW |