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

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

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 "chrome/utility/media_galleries/picasa_album_table_reader.h" 5 #include "chrome/utility/media_galleries/picasa_album_table_reader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 !name_column.ReadString(i, &name) || name.empty() || 84 !name_column.ReadString(i, &name) || name.empty() ||
85 !uid_column.ReadString(i, &uid) || uid.empty()) { 85 !uid_column.ReadString(i, &uid) || uid.empty()) {
86 continue; 86 continue;
87 } 87 }
88 88
89 base::Time timestamp = TimeFromMicrosoftVariantTime(date); 89 base::Time timestamp = TimeFromMicrosoftVariantTime(date);
90 90
91 if (category == kAlbumCategoryAlbum) { 91 if (category == kAlbumCategoryAlbum) {
92 std::string token; 92 std::string token;
93 if (!token_column.ReadString(i, &token) || token.empty() || 93 if (!token_column.ReadString(i, &token) || token.empty() ||
94 !StartsWithASCII(token, kAlbumTokenPrefix, false)) { 94 !base::StartsWithASCII(token, kAlbumTokenPrefix, false)) {
95 continue; 95 continue;
96 } 96 }
97 97
98 albums_.push_back(AlbumInfo(name, timestamp, uid, base::FilePath())); 98 albums_.push_back(AlbumInfo(name, timestamp, uid, base::FilePath()));
99 } else if (category == kAlbumCategoryFolder) { 99 } else if (category == kAlbumCategoryFolder) {
100 std::string filename; 100 std::string filename;
101 if (!filename_column.ReadString(i, &filename) || filename.empty()) 101 if (!filename_column.ReadString(i, &filename) || filename.empty())
102 continue; 102 continue;
103 103
104 base::FilePath path = 104 base::FilePath path =
105 base::FilePath(base::FilePath::FromUTF8Unsafe(filename)); 105 base::FilePath(base::FilePath::FromUTF8Unsafe(filename));
106 106
107 folders_.push_back(AlbumInfo(name, timestamp, uid, path)); 107 folders_.push_back(AlbumInfo(name, timestamp, uid, path));
108 } 108 }
109 } 109 }
110 110
111 initialized_ = true; 111 initialized_ = true;
112 return true; 112 return true;
113 } 113 }
114 114
115 } // namespace picasa 115 } // namespace picasa
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698