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

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

Issue 9316004: Move common file path related methods between chrome & content to file_util. I reduced the 4 meth... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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) 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 "content/browser/download/download_item_impl.h" 5 #include "content/browser/download/download_item_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 return delegate_->GetBrowserContext(); 784 return delegate_->GetBrowserContext();
785 } 785 }
786 786
787 FilePath DownloadItemImpl::GetTargetFilePath() const { 787 FilePath DownloadItemImpl::GetTargetFilePath() const {
788 return full_path_.DirName().Append(state_info_.target_name); 788 return full_path_.DirName().Append(state_info_.target_name);
789 } 789 }
790 790
791 FilePath DownloadItemImpl::GetFileNameToReportUser() const { 791 FilePath DownloadItemImpl::GetFileNameToReportUser() const {
792 if (state_info_.path_uniquifier > 0) { 792 if (state_info_.path_uniquifier > 0) {
793 FilePath name(state_info_.target_name); 793 FilePath name(state_info_.target_name);
794 DownloadFile::AppendNumberToPath(&name, state_info_.path_uniquifier); 794 file_util::AppendNumberToPath(&name, state_info_.path_uniquifier);
795 return name; 795 return name;
796 } 796 }
797 return state_info_.target_name; 797 return state_info_.target_name;
798 } 798 }
799 799
800 FilePath DownloadItemImpl::GetUserVerifiedFilePath() const { 800 FilePath DownloadItemImpl::GetUserVerifiedFilePath() const {
801 return (safety_state_ == DownloadItem::SAFE) ? 801 return (safety_state_ == DownloadItem::SAFE) ?
802 GetTargetFilePath() : full_path_; 802 GetTargetFilePath() : full_path_;
803 } 803 }
804 804
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 std::map<const void*, ExternalData*>::iterator it = 1002 std::map<const void*, ExternalData*>::iterator it =
1003 external_data_map_.find(key); 1003 external_data_map_.find(key);
1004 1004
1005 if (it == external_data_map_.end()) { 1005 if (it == external_data_map_.end()) {
1006 external_data_map_[key] = data; 1006 external_data_map_[key] = data;
1007 } else if (it->second != data) { 1007 } else if (it->second != data) {
1008 delete it->second; 1008 delete it->second;
1009 it->second = data; 1009 it->second = data;
1010 } 1010 }
1011 } 1011 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698