| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 AppCacheUpdateJob::URLFetcher::~URLFetcher() { | 103 AppCacheUpdateJob::URLFetcher::~URLFetcher() { |
| 104 } | 104 } |
| 105 | 105 |
| 106 void AppCacheUpdateJob::URLFetcher::Start() { | 106 void AppCacheUpdateJob::URLFetcher::Start() { |
| 107 request_->set_context(job_->service_->request_context()); | 107 request_->set_context(job_->service_->request_context()); |
| 108 request_->set_load_flags(request_->load_flags() | | 108 request_->set_load_flags(request_->load_flags() | |
| 109 net::LOAD_DISABLE_INTERCEPT); | 109 net::LOAD_DISABLE_INTERCEPT); |
| 110 if (existing_response_headers_) | 110 if (existing_response_headers_) |
| 111 AddConditionalHeaders(existing_response_headers_); | 111 AddConditionalHeaders(existing_response_headers_); |
| 112 job_->service_->InitializeUpdateRequest(request_.get()); |
| 112 request_->Start(); | 113 request_->Start(); |
| 113 } | 114 } |
| 114 | 115 |
| 115 void AppCacheUpdateJob::URLFetcher::OnReceivedRedirect( | 116 void AppCacheUpdateJob::URLFetcher::OnReceivedRedirect( |
| 116 net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { | 117 net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { |
| 117 DCHECK(request_ == request); | 118 DCHECK(request_ == request); |
| 118 // Redirect is not allowed by the update process. | 119 // Redirect is not allowed by the update process. |
| 119 request->Cancel(); | 120 request->Cancel(); |
| 120 OnResponseCompleted(); | 121 OnResponseCompleted(); |
| 121 } | 122 } |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1327 | 1328 |
| 1328 // Break the connection with the group so the group cannot call delete | 1329 // Break the connection with the group so the group cannot call delete |
| 1329 // on this object after we've posted a task to delete ourselves. | 1330 // on this object after we've posted a task to delete ourselves. |
| 1330 group_->SetUpdateStatus(AppCacheGroup::IDLE); | 1331 group_->SetUpdateStatus(AppCacheGroup::IDLE); |
| 1331 group_ = NULL; | 1332 group_ = NULL; |
| 1332 | 1333 |
| 1333 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1334 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 1334 } | 1335 } |
| 1335 | 1336 |
| 1336 } // namespace appcache | 1337 } // namespace appcache |
| OLD | NEW |