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

Side by Side Diff: chrome/utility/media_galleries/iapps_xml_utils.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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/utility/importer/firefox_importer.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/utility/media_galleries/iapps_xml_utils.h" 5 #include "chrome/utility/media_galleries/iapps_xml_utils.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "third_party/libxml/chromium/libxml_utils.h" 10 #include "third_party/libxml/chromium/libxml_utils.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return result; 83 return result;
84 84
85 // A "reasonable" artificial limit. 85 // A "reasonable" artificial limit.
86 // TODO(vandebo): Add a UMA to figure out what common values are. 86 // TODO(vandebo): Add a UMA to figure out what common values are.
87 const int64_t kMaxLibraryFileSize = 150 * 1024 * 1024; 87 const int64_t kMaxLibraryFileSize = 150 * 1024 * 1024;
88 base::File::Info file_info; 88 base::File::Info file_info;
89 if (!file.GetInfo(&file_info) || file_info.size > kMaxLibraryFileSize) 89 if (!file.GetInfo(&file_info) || file_info.size > kMaxLibraryFileSize)
90 return result; 90 return result;
91 91
92 result.resize(file_info.size); 92 result.resize(file_info.size);
93 int bytes_read = file.Read(0, string_as_array(&result), file_info.size); 93 int bytes_read = file.Read(0, base::string_as_array(&result), file_info.size);
94 if (bytes_read != file_info.size) 94 if (bytes_read != file_info.size)
95 result.clear(); 95 result.clear();
96 96
97 return result; 97 return result;
98 } 98 }
99 99
100 XmlDictReader::XmlDictReader(XmlReader* reader) : reader_(reader) {} 100 XmlDictReader::XmlDictReader(XmlReader* reader) : reader_(reader) {}
101 101
102 XmlDictReader::~XmlDictReader() {} 102 XmlDictReader::~XmlDictReader() {}
103 103
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 bool XmlDictReader::FinishedOk() { 148 bool XmlDictReader::FinishedOk() {
149 return true; 149 return true;
150 } 150 }
151 151
152 bool XmlDictReader::SkipToNext() { 152 bool XmlDictReader::SkipToNext() {
153 return SkipToNextElement(reader_) && reader_->Next(); 153 return SkipToNextElement(reader_) && reader_->Next();
154 } 154 }
155 155
156 bool XmlDictReader::Found(const std::string& key) const { 156 bool XmlDictReader::Found(const std::string& key) const {
157 return ContainsKey(found_, key); 157 return base::ContainsKey(found_, key);
158 } 158 }
159 159
160 } // namespace iapps 160 } // namespace iapps
OLDNEW
« no previous file with comments | « chrome/utility/importer/firefox_importer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698