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

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

Issue 23020015: In chrome://crashes, re-read the crash list on page reload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « chrome/browser/ui/webui/crashes_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (base::PathExists(upload_log_path_)) { 52 if (base::PathExists(upload_log_path_)) {
53 std::string contents; 53 std::string contents;
54 base::ReadFileToString(upload_log_path_, &contents); 54 base::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 uploads_.clear();
57 ParseLogEntries(log_entries); 58 ParseLogEntries(log_entries);
58 } 59 }
59 } 60 }
60 61
61 void UploadList::AppendUploadInfo(const UploadInfo& info) { 62 void UploadList::AppendUploadInfo(const UploadInfo& info) {
62 uploads_.push_back(info); 63 uploads_.push_back(info);
63 } 64 }
64 65
65 void UploadList::ParseLogEntries( 66 void UploadList::ParseLogEntries(
66 const std::vector<std::string>& log_entries) { 67 const std::vector<std::string>& log_entries) {
(...skipping 19 matching lines...) Expand all
86 delegate_->OnUploadListAvailable(); 87 delegate_->OnUploadListAvailable();
87 } 88 }
88 89
89 void UploadList::GetUploads(unsigned int max_count, 90 void UploadList::GetUploads(unsigned int max_count,
90 std::vector<UploadInfo>* uploads) { 91 std::vector<UploadInfo>* uploads) {
91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
92 std::copy(uploads_.begin(), 93 std::copy(uploads_.begin(),
93 uploads_.begin() + std::min<size_t>(uploads_.size(), max_count), 94 uploads_.begin() + std::min<size_t>(uploads_.size(), max_count),
94 std::back_inserter(*uploads)); 95 std::back_inserter(*uploads));
95 } 96 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/crashes_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698