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 "content/browser/download/save_package.h" | 5 #include "content/browser/download/save_package.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 // Call write file functionality in FILE thread. | 1035 // Call write file functionality in FILE thread. |
1036 BrowserThread::PostTask( | 1036 BrowserThread::PostTask( |
1037 BrowserThread::FILE, FROM_HERE, | 1037 BrowserThread::FILE, FROM_HERE, |
1038 base::Bind(&SaveFileManager::UpdateSaveProgress, file_manager_, | 1038 base::Bind(&SaveFileManager::UpdateSaveProgress, file_manager_, |
1039 save_item->id(), base::RetainedRef(new_data), | 1039 save_item->id(), base::RetainedRef(new_data), |
1040 static_cast<int>(data.size()))); | 1040 static_cast<int>(data.size()))); |
1041 } | 1041 } |
1042 | 1042 |
1043 // Current frame is completed saving, call finish in FILE thread. | 1043 // Current frame is completed saving, call finish in FILE thread. |
1044 if (end_of_data) { | 1044 if (end_of_data) { |
1045 DVLOG(20) << " " << __FUNCTION__ << "()" | 1045 DVLOG(20) << __func__ << "() save_item_id = " << save_item->id() |
1046 << " save_item_id = " << save_item->id() << " url = \"" | 1046 << " url = \"" << save_item->url().spec() << "\""; |
1047 << save_item->url().spec() << "\""; | |
1048 BrowserThread::PostTask( | 1047 BrowserThread::PostTask( |
1049 BrowserThread::FILE, FROM_HERE, | 1048 BrowserThread::FILE, FROM_HERE, |
1050 base::Bind(&SaveFileManager::SaveFinished, file_manager_, | 1049 base::Bind(&SaveFileManager::SaveFinished, file_manager_, |
1051 save_item->id(), id(), true)); | 1050 save_item->id(), id(), true)); |
1052 number_of_frames_pending_response_--; | 1051 number_of_frames_pending_response_--; |
1053 DCHECK_LE(0, number_of_frames_pending_response_); | 1052 DCHECK_LE(0, number_of_frames_pending_response_); |
1054 } | 1053 } |
1055 } | 1054 } |
1056 | 1055 |
1057 // Ask for all savable resource links from backend, include main frame and | 1056 // Ask for all savable resource links from backend, include main frame and |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 } | 1463 } |
1465 | 1464 |
1466 void SavePackage::FinalizeDownloadEntry() { | 1465 void SavePackage::FinalizeDownloadEntry() { |
1467 DCHECK(download_); | 1466 DCHECK(download_); |
1468 | 1467 |
1469 download_manager_->OnSavePackageSuccessfullyFinished(download_); | 1468 download_manager_->OnSavePackageSuccessfullyFinished(download_); |
1470 RemoveObservers(); | 1469 RemoveObservers(); |
1471 } | 1470 } |
1472 | 1471 |
1473 } // namespace content | 1472 } // namespace content |
OLD | NEW |