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

Side by Side Diff: components/upload_list/upload_list.cc

Issue 2301943003: Show not uploaded crashes for Android. (Closed)
Patch Set: sync Created 4 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
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 "components/upload_list/upload_list.h" 5 #include "components/upload_list/upload_list.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 if (base::PathExists(upload_log_path_)) { 71 if (base::PathExists(upload_log_path_)) {
72 std::string contents; 72 std::string contents;
73 base::ReadFileToString(upload_log_path_, &contents); 73 base::ReadFileToString(upload_log_path_, &contents);
74 std::vector<std::string> log_entries = base::SplitString( 74 std::vector<std::string> log_entries = base::SplitString(
75 contents, base::kWhitespaceASCII, base::KEEP_WHITESPACE, 75 contents, base::kWhitespaceASCII, base::KEEP_WHITESPACE,
76 base::SPLIT_WANT_NONEMPTY); 76 base::SPLIT_WANT_NONEMPTY);
77 ParseLogEntries(log_entries, uploads); 77 ParseLogEntries(log_entries, uploads);
78 } 78 }
79 } 79 }
80 80
81 const base::FilePath& UploadList::upload_log_path() {
82 return upload_log_path_;
83 }
84
81 void UploadList::ParseLogEntries( 85 void UploadList::ParseLogEntries(
82 const std::vector<std::string>& log_entries, 86 const std::vector<std::string>& log_entries,
83 std::vector<UploadInfo>* uploads) { 87 std::vector<UploadInfo>* uploads) {
84 std::vector<std::string>::const_reverse_iterator i; 88 std::vector<std::string>::const_reverse_iterator i;
85 for (i = log_entries.rbegin(); i != log_entries.rend(); ++i) { 89 for (i = log_entries.rbegin(); i != log_entries.rend(); ++i) {
86 std::vector<std::string> components = base::SplitString( 90 std::vector<std::string> components = base::SplitString(
87 *i, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 91 *i, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
88 // Skip any blank (or corrupted) lines. 92 // Skip any blank (or corrupted) lines.
89 if (components.size() < 2 || components.size() > 5) 93 if (components.size() < 2 || components.size() > 5)
90 continue; 94 continue;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 delegate_->OnUploadListAvailable(); 130 delegate_->OnUploadListAvailable();
127 } 131 }
128 132
129 void UploadList::GetUploads(size_t max_count, 133 void UploadList::GetUploads(size_t max_count,
130 std::vector<UploadInfo>* uploads) { 134 std::vector<UploadInfo>* uploads) {
131 DCHECK(thread_checker_.CalledOnValidThread()); 135 DCHECK(thread_checker_.CalledOnValidThread());
132 std::copy(uploads_.begin(), 136 std::copy(uploads_.begin(),
133 uploads_.begin() + std::min(uploads_.size(), max_count), 137 uploads_.begin() + std::min(uploads_.size(), max_count),
134 std::back_inserter(*uploads)); 138 std::back_inserter(*uploads));
135 } 139 }
OLDNEW
« components/upload_list/upload_list.h ('K') | « components/upload_list/upload_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698