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 "webkit/appcache/appcache_update_job.h" | 5 #include "webkit/appcache/appcache_update_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Helper class to fetch resources. Depending on the fetch type, | 91 // Helper class to fetch resources. Depending on the fetch type, |
92 // can either fetch to an in-memory string or write the response | 92 // can either fetch to an in-memory string or write the response |
93 // data out to the disk cache. | 93 // data out to the disk cache. |
94 AppCacheUpdateJob::URLFetcher::URLFetcher( | 94 AppCacheUpdateJob::URLFetcher::URLFetcher( |
95 const GURL& url, FetchType fetch_type, AppCacheUpdateJob* job) | 95 const GURL& url, FetchType fetch_type, AppCacheUpdateJob* job) |
96 : url_(url), | 96 : url_(url), |
97 job_(job), | 97 job_(job), |
98 fetch_type_(fetch_type), | 98 fetch_type_(fetch_type), |
99 retry_503_attempts_(0), | 99 retry_503_attempts_(0), |
100 buffer_(new net::IOBuffer(kBufferSize)), | 100 buffer_(new net::IOBuffer(kBufferSize)), |
101 ALLOW_THIS_IN_INITIALIZER_LIST(request_( | 101 request_(job->service_->request_context()->CreateRequest(url, this)) { |
102 job->service_->request_context()->CreateRequest(url, this))) { | |
103 } | 102 } |
104 | 103 |
105 AppCacheUpdateJob::URLFetcher::~URLFetcher() { | 104 AppCacheUpdateJob::URLFetcher::~URLFetcher() { |
106 } | 105 } |
107 | 106 |
108 void AppCacheUpdateJob::URLFetcher::Start() { | 107 void AppCacheUpdateJob::URLFetcher::Start() { |
109 request_->set_first_party_for_cookies(job_->manifest_url_); | 108 request_->set_first_party_for_cookies(job_->manifest_url_); |
110 request_->set_load_flags(request_->load_flags() | | 109 request_->set_load_flags(request_->load_flags() | |
111 net::LOAD_DISABLE_INTERCEPT); | 110 net::LOAD_DISABLE_INTERCEPT); |
112 if (existing_response_headers_) | 111 if (existing_response_headers_) |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 | 1340 |
1342 // Break the connection with the group so the group cannot call delete | 1341 // Break the connection with the group so the group cannot call delete |
1343 // on this object after we've posted a task to delete ourselves. | 1342 // on this object after we've posted a task to delete ourselves. |
1344 group_->SetUpdateStatus(AppCacheGroup::IDLE); | 1343 group_->SetUpdateStatus(AppCacheGroup::IDLE); |
1345 group_ = NULL; | 1344 group_ = NULL; |
1346 | 1345 |
1347 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1346 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
1348 } | 1347 } |
1349 | 1348 |
1350 } // namespace appcache | 1349 } // namespace appcache |
OLD | NEW |