| 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 "chrome/browser/google_apis/request_registry.h" | 5 #include "chrome/browser/google_apis/request_registry.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
| 8 | 8 |
| 9 using content::BrowserThread; | 9 using content::BrowserThread; |
| 10 | 10 |
| 11 namespace google_apis { | 11 namespace google_apis { |
| 12 | 12 |
| 13 RequestProgressStatus::RequestProgressStatus(const base::FilePath& path) | 13 RequestProgressStatus::RequestProgressStatus() |
| 14 : request_id(-1), | 14 : request_id(-1), |
| 15 file_path(path), | |
| 16 transfer_state(REQUEST_NOT_STARTED) { | 15 transfer_state(REQUEST_NOT_STARTED) { |
| 17 } | 16 } |
| 18 | 17 |
| 19 RequestRegistry::Request::Request(RequestRegistry* registry) | 18 RequestRegistry::Request::Request(RequestRegistry* registry) |
| 20 : registry_(registry), | 19 : registry_(registry) { |
| 21 progress_status_(base::FilePath()) { | |
| 22 } | |
| 23 | |
| 24 RequestRegistry::Request::Request(RequestRegistry* registry, | |
| 25 const base::FilePath& path) | |
| 26 : registry_(registry), | |
| 27 progress_status_(path) { | |
| 28 } | 20 } |
| 29 | 21 |
| 30 RequestRegistry::Request::~Request() { | 22 RequestRegistry::Request::~Request() { |
| 31 } | 23 } |
| 32 | 24 |
| 33 void RequestRegistry::Request::Cancel() { | 25 void RequestRegistry::Request::Cancel() { |
| 34 DoCancel(); | 26 DoCancel(); |
| 35 NotifyFinish(REQUEST_FAILED); | 27 NotifyFinish(REQUEST_FAILED); |
| 36 } | 28 } |
| 37 | 29 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 65 |
| 74 void RequestRegistry::OnRequestFinish(RequestID id) { | 66 void RequestRegistry::OnRequestFinish(RequestID id) { |
| 75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 76 | 68 |
| 77 DVLOG(1) << "Request[" << id << "] finished."; | 69 DVLOG(1) << "Request[" << id << "] finished."; |
| 78 if (in_flight_requests_.Lookup(id)) | 70 if (in_flight_requests_.Lookup(id)) |
| 79 in_flight_requests_.Remove(id); | 71 in_flight_requests_.Remove(id); |
| 80 } | 72 } |
| 81 | 73 |
| 82 } // namespace google_apis | 74 } // namespace google_apis |
| OLD | NEW |