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

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

Issue 9570005: Added callback to DownloadUrl() so we can find download failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 8 years, 9 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "content/browser/download/download_stats.h" 10 #include "content/browser/download/download_stats.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 save_info.file_stream = file_stream_; 134 save_info.file_stream = file_stream_;
135 135
136 download_stats::RecordDownloadSource( 136 download_stats::RecordDownloadSource(
137 download_stats::INITIATED_BY_DRAG_N_DROP); 137 download_stats::INITIATED_BY_DRAG_N_DROP);
138 download_manager_->DownloadUrl(url_, 138 download_manager_->DownloadUrl(url_,
139 referrer_, 139 referrer_,
140 referrer_encoding_, 140 referrer_encoding_,
141 false, 141 false,
142 -1, 142 -1,
143 save_info, 143 save_info,
144 web_contents_); 144 web_contents_,
145 DownloadManager::OnStartedCallback());
145 } 146 }
146 147
147 void DragDownloadFile::DownloadCompleted(bool is_successful) { 148 void DragDownloadFile::DownloadCompleted(bool is_successful) {
148 #if defined(OS_WIN) 149 #if defined(OS_WIN)
149 // If not in drag-and-drop thread, defer the running to it. 150 // If not in drag-and-drop thread, defer the running to it.
150 if (drag_message_loop_ != MessageLoop::current()) { 151 if (drag_message_loop_ != MessageLoop::current()) {
151 drag_message_loop_->PostTask( 152 drag_message_loop_->PostTask(
152 FROM_HERE, 153 FROM_HERE,
153 base::Bind(&DragDownloadFile::DownloadCompleted, this, is_successful)); 154 base::Bind(&DragDownloadFile::DownloadCompleted, this, is_successful));
154 return; 155 return;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 232
232 void DragDownloadFile::QuitNestedMessageLoop() { 233 void DragDownloadFile::QuitNestedMessageLoop() {
233 AssertCurrentlyOnDragThread(); 234 AssertCurrentlyOnDragThread();
234 235
235 if (is_running_nested_message_loop_) { 236 if (is_running_nested_message_loop_) {
236 is_running_nested_message_loop_ = false; 237 is_running_nested_message_loop_ = false;
237 MessageLoop::current()->Quit(); 238 MessageLoop::current()->Quit();
238 } 239 }
239 } 240 }
240 #endif 241 #endif
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/renderer_host/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698