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

Side by Side Diff: chrome/browser/download/download_file.cc

Issue 7112011: Change DownloadProcessHandle to be more of an encapsulated class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get rid of cancel code in download_util. Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/download/download_file.h" 5 #include "chrome/browser/download/download_file.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 12 matching lines...) Expand all
23 id_(info->download_id), 23 id_(info->download_id),
24 process_handle_(info->process_handle), 24 process_handle_(info->process_handle),
25 download_manager_(download_manager) { 25 download_manager_(download_manager) {
26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
27 } 27 }
28 28
29 DownloadFile::~DownloadFile() { 29 DownloadFile::~DownloadFile() {
30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
31 } 31 }
32 32
33 void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) { 33 void DownloadFile::CancelDownloadRequest() {
Paweł Hajdan Jr. 2011/06/04 08:58:51 nit: Please add DCHECK(BrowserThread::CurrentlyOn(
Randy Smith (Not in Mondays) 2011/06/07 22:41:11 Done.
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 34 process_handle_.CancelRequest();
35 download_util::CancelDownloadRequest(rdh, process_handle_);
36 } 35 }
37 36
38 DownloadManager* DownloadFile::GetDownloadManager() { 37 DownloadManager* DownloadFile::GetDownloadManager() {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
40 return download_manager_.get(); 39 return download_manager_.get();
41 } 40 }
42 41
43 std::string DownloadFile::DebugString() const { 42 std::string DownloadFile::DebugString() const {
44 return base::StringPrintf("{" 43 return base::StringPrintf("{"
45 " id_ = " "%d" 44 " id_ = " "%d"
46 " child_id = " "%d" 45 " process_handle = %s"
47 " request_id = " "%d"
48 " render_view_id = " "%d"
49 " Base File = %s" 46 " Base File = %s"
50 " }", 47 " }",
51 id_, 48 id_,
52 process_handle_.child_id(), 49 process_handle_.DebugString().c_str(),
53 process_handle_.request_id(),
54 process_handle_.render_view_id(),
55 BaseFile::DebugString().c_str()); 50 BaseFile::DebugString().c_str());
56 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698