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

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

Issue 5852001: Fix the last scoped_refptr misuses in NewRunnableMethod. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 | remoting/jingle_glue/jingle_client_unittest.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_item.h" 5 #include "chrome/browser/download/download_item.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 398
399 void DownloadItem::OnSafeDownloadFinished(DownloadFileManager* file_manager) { 399 void DownloadItem::OnSafeDownloadFinished(DownloadFileManager* file_manager) {
400 DCHECK_EQ(SAFE, safety_state()); 400 DCHECK_EQ(SAFE, safety_state());
401 DCHECK(file_manager); 401 DCHECK(file_manager);
402 if (NeedsRename()) { 402 if (NeedsRename()) {
403 BrowserThread::PostTask( 403 BrowserThread::PostTask(
404 BrowserThread::FILE, FROM_HERE, 404 BrowserThread::FILE, FROM_HERE,
405 NewRunnableMethod( 405 NewRunnableMethod(
406 file_manager, &DownloadFileManager::OnFinalDownloadName, 406 file_manager, &DownloadFileManager::OnFinalDownloadName,
407 id(), GetTargetFilePath(), false, download_manager_)); 407 id(), GetTargetFilePath(), false,
408 make_scoped_refptr(download_manager_)));
408 return; 409 return;
409 } 410 }
410 411
411 Finished(); 412 Finished();
412 } 413 }
413 414
414 void DownloadItem::OnDownloadRenamedToFinalName(const FilePath& full_path) { 415 void DownloadItem::OnDownloadRenamedToFinalName(const FilePath& full_path) {
415 bool needed_rename = NeedsRename(); 416 bool needed_rename = NeedsRename();
416 417
417 Rename(full_path); 418 Rename(full_path);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 target_name_.value().c_str(), 491 target_name_.value().c_str(),
491 full_path().value().c_str(), 492 full_path().value().c_str(),
492 DebugSafetyStateString(safety_state())); 493 DebugSafetyStateString(safety_state()));
493 } 494 }
494 495
495 description += base::StringPrintf(" state = %s }", 496 description += base::StringPrintf(" state = %s }",
496 DebugDownloadStateString(state())); 497 DebugDownloadStateString(state()));
497 498
498 return description; 499 return description;
499 } 500 }
OLDNEW
« no previous file with comments | « no previous file | remoting/jingle_glue/jingle_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698