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

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

Issue 148133007: [Downloads] Always call DM::StartDownload() for explicit downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typos Created 4 years, 10 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/drag_download_file.h" 5 #include "content/browser/download/drag_download_file.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 private: 90 private:
91 ~DragDownloadFileUI() override { 91 ~DragDownloadFileUI() override {
92 DCHECK_CURRENTLY_ON(BrowserThread::UI); 92 DCHECK_CURRENTLY_ON(BrowserThread::UI);
93 if (download_item_) 93 if (download_item_)
94 download_item_->RemoveObserver(this); 94 download_item_->RemoveObserver(this);
95 } 95 }
96 96
97 void OnDownloadStarted(DownloadItem* item, 97 void OnDownloadStarted(DownloadItem* item,
98 DownloadInterruptReason interrupt_reason) { 98 DownloadInterruptReason interrupt_reason) {
99 DCHECK_CURRENTLY_ON(BrowserThread::UI); 99 DCHECK_CURRENTLY_ON(BrowserThread::UI);
100 if (!item) { 100 if (!item || item->GetState() != DownloadItem::IN_PROGRESS) {
101 DCHECK_NE(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason); 101 DCHECK(!item || item->GetLastReason() != DOWNLOAD_INTERRUPT_REASON_NONE);
102 on_completed_loop_->task_runner()->PostTask( 102 on_completed_loop_->task_runner()->PostTask(
103 FROM_HERE, base::Bind(on_completed_, false)); 103 FROM_HERE, base::Bind(on_completed_, false));
104 return; 104 return;
105 } 105 }
106 DCHECK_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason); 106 DCHECK_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
107 download_item_ = item; 107 download_item_ = item;
108 download_item_->AddObserver(this); 108 download_item_->AddObserver(this);
109 } 109 }
110 110
111 // DownloadItem::Observer: 111 // DownloadItem::Observer:
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 void DragDownloadFile::CheckThread() { 242 void DragDownloadFile::CheckThread() {
243 #if defined(OS_WIN) 243 #if defined(OS_WIN)
244 DCHECK(drag_message_loop_ == base::MessageLoop::current()); 244 DCHECK(drag_message_loop_ == base::MessageLoop::current());
245 #else 245 #else
246 DCHECK_CURRENTLY_ON(BrowserThread::UI); 246 DCHECK_CURRENTLY_ON(BrowserThread::UI);
247 #endif 247 #endif
248 } 248 }
249 249
250 } // namespace content 250 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/url_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698