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

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

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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) 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/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/browser/download/download_stats.h" 9 #include "content/browser/download/download_stats.h"
10 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 void DragDownloadFile::Start(ui::DownloadFileObserver* observer) { 183 void DragDownloadFile::Start(ui::DownloadFileObserver* observer) {
184 CheckThread(); 184 CheckThread();
185 185
186 if (state_ != INITIALIZED) 186 if (state_ != INITIALIZED)
187 return; 187 return;
188 state_ = STARTED; 188 state_ = STARTED;
189 189
190 DCHECK(!observer_.get()); 190 DCHECK(!observer_.get());
191 observer_ = observer; 191 observer_ = observer;
192 DCHECK(observer_); 192 DCHECK(observer_.get());
193 193
194 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( 194 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
195 &DragDownloadFileUI::InitiateDownload, base::Unretained(drag_ui_), 195 &DragDownloadFileUI::InitiateDownload, base::Unretained(drag_ui_),
196 base::Passed(&file_stream_), file_path_)); 196 base::Passed(&file_stream_), file_path_));
197 } 197 }
198 198
199 bool DragDownloadFile::Wait() { 199 bool DragDownloadFile::Wait() {
200 CheckThread(); 200 CheckThread();
201 if (state_ == STARTED) 201 if (state_ == STARTED)
202 nested_loop_.Run(); 202 nested_loop_.Run();
(...skipping 27 matching lines...) Expand all
230 230
231 void DragDownloadFile::CheckThread() { 231 void DragDownloadFile::CheckThread() {
232 #if defined(OS_WIN) 232 #if defined(OS_WIN)
233 DCHECK(drag_message_loop_ == base::MessageLoop::current()); 233 DCHECK(drag_message_loop_ == base::MessageLoop::current());
234 #else 234 #else
235 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 235 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
236 #endif 236 #endif
237 } 237 }
238 238
239 } // namespace content 239 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/drag_download_file_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698