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

Side by Side Diff: webkit/appcache/appcache_url_request_job.cc

Issue 10534100: Decouple URLRequestJob from URLRequestContext; access NetworkDelegate as a contructor parameter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 (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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 return; 286 return;
285 } 287 }
286 288
287 // If multiple ranges are requested, we play dumb and 289 // If multiple ranges are requested, we play dumb and
288 // return the entire response with 200 OK. 290 // return the entire response with 200 OK.
289 if (ranges.size() == 1U) 291 if (ranges.size() == 1U)
290 range_requested_ = ranges[0]; 292 range_requested_ = ranges[0];
291 } 293 }
292 294
293 } // namespace appcache 295 } // namespace appcache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698