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

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

Issue 10332130: Use defer out-params instead of ResourceDispatcherHostImpl::PauseRequest(...true) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | content/browser/download/download_request_handle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/download_file_manager.h" 5 #include "content/browser/download/download_file_manager.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 &DownloadManager::OnDownloadInterrupted, 111 &DownloadManager::OnDownloadInterrupted,
112 download_manager, 112 download_manager,
113 info->download_id.local(), 113 info->download_id.local(),
114 0, 114 0,
115 "", 115 "",
116 content::ConvertNetErrorToInterruptReason( 116 content::ConvertNetErrorToInterruptReason(
117 init_result, content::DOWNLOAD_INTERRUPT_FROM_DISK))); 117 init_result, content::DOWNLOAD_INTERRUPT_FROM_DISK)));
118 } else { 118 } else {
119 DCHECK(GetDownloadFile(info->download_id) == NULL); 119 DCHECK(GetDownloadFile(info->download_id) == NULL);
120 downloads_[info->download_id] = download_file.release(); 120 downloads_[info->download_id] = download_file.release();
121
122 // The file is now ready, we can un-pause the request and start saving data.
123 request_handle.ResumeRequest();
124 } 121 }
125 122
126 BrowserThread::PostTask( 123 BrowserThread::PostTask(
127 BrowserThread::UI, FROM_HERE, 124 BrowserThread::UI, FROM_HERE,
128 base::Bind(&DownloadManager::StartDownload, download_manager, 125 base::Bind(&DownloadManager::StartDownload, download_manager,
129 info->download_id.local())); 126 info->download_id.local()));
130 } 127 }
131 128
132 DownloadFile* DownloadFileManager::GetDownloadFile( 129 DownloadFile* DownloadFileManager::GetDownloadFile(
133 DownloadId global_id) { 130 DownloadId global_id) {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 DownloadFile* download_file = downloads_[global_id]; 461 DownloadFile* download_file = downloads_[global_id];
465 462
466 VLOG(20) << " " << __FUNCTION__ << "()" 463 VLOG(20) << " " << __FUNCTION__ << "()"
467 << " id = " << global_id 464 << " id = " << global_id
468 << " download_file = " << download_file->DebugString(); 465 << " download_file = " << download_file->DebugString();
469 466
470 downloads_.erase(global_id); 467 downloads_.erase(global_id);
471 468
472 delete download_file; 469 delete download_file;
473 } 470 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_request_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698