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

Side by Side Diff: content/browser/download/save_package.cc

Issue 22920005: Refactor MHTMLGenerator to allow getting sending the data to a file descriptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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 "content/browser/download/save_package.h" 5 #include "content/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 save_source); 356 save_source);
357 // Add this item to waiting list. 357 // Add this item to waiting list.
358 waiting_item_queue_.push(save_item); 358 waiting_item_queue_.push(save_item);
359 all_save_items_count_ = 1; 359 all_save_items_count_ = 1;
360 download_->SetTotalBytes(1); 360 download_->SetTotalBytes(1);
361 361
362 DoSavingProcess(); 362 DoSavingProcess();
363 } 363 }
364 } 364 }
365 365
366 void SavePackage::OnMHTMLGenerated(const base::FilePath& path, int64 size) { 366 void SavePackage::OnMHTMLGenerated(int64 size) {
367 if (size <= 0) { 367 if (size <= 0) {
368 Cancel(false); 368 Cancel(false);
369 return; 369 return;
370 } 370 }
371 wrote_to_completed_file_ = true; 371 wrote_to_completed_file_ = true;
372 372
373 // Hack to avoid touching download_ after user cancel. 373 // Hack to avoid touching download_ after user cancel.
374 // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem 374 // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
375 // with SavePackage flow. 375 // with SavePackage flow.
376 if (download_->GetState() == DownloadItem::IN_PROGRESS) { 376 if (download_->GetState() == DownloadItem::IN_PROGRESS) {
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 1446
1447 void SavePackage::FinalizeDownloadEntry() { 1447 void SavePackage::FinalizeDownloadEntry() {
1448 DCHECK(download_); 1448 DCHECK(download_);
1449 DCHECK(download_manager_); 1449 DCHECK(download_manager_);
1450 1450
1451 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1451 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1452 StopObservation(); 1452 StopObservation();
1453 } 1453 }
1454 1454
1455 } // namespace content 1455 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698