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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc

Issue 1214183008: Update StartsWith calls to use new versions in chrome and content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/sync_file_system/drive_backend/drive_backend_util.h" 5 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 case google_apis::DRIVE_NO_SPACE: 137 case google_apis::DRIVE_NO_SPACE:
138 return SYNC_FILE_ERROR_NO_SPACE; 138 return SYNC_FILE_ERROR_NO_SPACE;
139 } 139 }
140 140
141 NOTREACHED(); 141 NOTREACHED();
142 return SYNC_STATUS_FAILED; 142 return SYNC_STATUS_FAILED;
143 } 143 }
144 144
145 bool RemovePrefix(const std::string& str, const std::string& prefix, 145 bool RemovePrefix(const std::string& str, const std::string& prefix,
146 std::string* out) { 146 std::string* out) {
147 if (!base::StartsWithASCII(str, prefix, true)) { 147 if (!base::StartsWith(str, prefix, base::CompareCase::SENSITIVE)) {
148 if (out) 148 if (out)
149 *out = str; 149 *out = str;
150 return false; 150 return false;
151 } 151 }
152 152
153 if (out) 153 if (out)
154 *out = str.substr(prefix.size()); 154 *out = str.substr(prefix.size());
155 return true; 155 return true;
156 } 156 }
157 157
(...skipping 12 matching lines...) Expand all
170 } else if (status.IsNotFound()) { 170 } else if (status.IsNotFound()) {
171 service_metadata.reset(new ServiceMetadata); 171 service_metadata.reset(new ServiceMetadata);
172 service_metadata->set_next_tracker_id(1); 172 service_metadata->set_next_tracker_id(1);
173 } 173 }
174 174
175 return service_metadata.Pass(); 175 return service_metadata.Pass();
176 } 176 }
177 177
178 } // namespace drive_backend 178 } // namespace drive_backend
179 } // namespace sync_file_system 179 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698