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

Side by Side Diff: chrome/browser/upload_list.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/upload_list.h" 5 #include "chrome/browser/upload_list.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void UploadList::LoadUploadListAndInformDelegateOfCompletion() { 43 void UploadList::LoadUploadListAndInformDelegateOfCompletion() {
44 LoadUploadList(); 44 LoadUploadList();
45 BrowserThread::PostTask( 45 BrowserThread::PostTask(
46 BrowserThread::UI, 46 BrowserThread::UI,
47 FROM_HERE, 47 FROM_HERE,
48 base::Bind(&UploadList::InformDelegateOfCompletion, this)); 48 base::Bind(&UploadList::InformDelegateOfCompletion, this));
49 } 49 }
50 50
51 void UploadList::LoadUploadList() { 51 void UploadList::LoadUploadList() {
52 if (file_util::PathExists(upload_log_path_)) { 52 if (base::PathExists(upload_log_path_)) {
53 std::string contents; 53 std::string contents;
54 file_util::ReadFileToString(upload_log_path_, &contents); 54 file_util::ReadFileToString(upload_log_path_, &contents);
55 std::vector<std::string> log_entries; 55 std::vector<std::string> log_entries;
56 base::SplitStringAlongWhitespace(contents, &log_entries); 56 base::SplitStringAlongWhitespace(contents, &log_entries);
57 ParseLogEntries(log_entries); 57 ParseLogEntries(log_entries);
58 } 58 }
59 } 59 }
60 60
61 void UploadList::AppendUploadInfo(const UploadInfo& info) { 61 void UploadList::AppendUploadInfo(const UploadInfo& info) {
62 uploads_.push_back(info); 62 uploads_.push_back(info);
(...skipping 23 matching lines...) Expand all
86 delegate_->OnUploadListAvailable(); 86 delegate_->OnUploadListAvailable();
87 } 87 }
88 88
89 void UploadList::GetUploads(unsigned int max_count, 89 void UploadList::GetUploads(unsigned int max_count,
90 std::vector<UploadInfo>* uploads) { 90 std::vector<UploadInfo>* uploads) {
91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
92 std::copy(uploads_.begin(), 92 std::copy(uploads_.begin(),
93 uploads_.begin() + std::min<size_t>(uploads_.size(), max_count), 93 uploads_.begin() + std::min<size_t>(uploads_.size(), max_count),
94 std::back_inserter(*uploads)); 94 std::back_inserter(*uploads));
95 } 95 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/advanced_options_utils_x11.cc ('k') | chrome/browser/user_data_dir_extractor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698