| OLD | NEW |
| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 util::Log(logging::LOG_WARNING, | 147 util::Log(logging::LOG_WARNING, |
| 148 FROM_HERE, | 148 FROM_HERE, |
| 149 "Got unexpected error: %d", | 149 "Got unexpected error: %d", |
| 150 static_cast<int>(error)); | 150 static_cast<int>(error)); |
| 151 return SYNC_STATUS_FAILED; | 151 return SYNC_STATUS_FAILED; |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool RemovePrefix(const std::string& str, const std::string& prefix, | 154 bool RemovePrefix(const std::string& str, const std::string& prefix, |
| 155 std::string* out) { | 155 std::string* out) { |
| 156 if (!base::StartsWithASCII(str, prefix, true)) { | 156 if (!base::StartsWith(str, prefix, base::CompareCase::SENSITIVE)) { |
| 157 if (out) | 157 if (out) |
| 158 *out = str; | 158 *out = str; |
| 159 return false; | 159 return false; |
| 160 } | 160 } |
| 161 | 161 |
| 162 if (out) | 162 if (out) |
| 163 *out = str.substr(prefix.size()); | 163 *out = str.substr(prefix.size()); |
| 164 return true; | 164 return true; |
| 165 } | 165 } |
| 166 | 166 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 179 } else if (status.IsNotFound()) { | 179 } else if (status.IsNotFound()) { |
| 180 service_metadata.reset(new ServiceMetadata); | 180 service_metadata.reset(new ServiceMetadata); |
| 181 service_metadata->set_next_tracker_id(1); | 181 service_metadata->set_next_tracker_id(1); |
| 182 } | 182 } |
| 183 | 183 |
| 184 return service_metadata.Pass(); | 184 return service_metadata.Pass(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace drive_backend | 187 } // namespace drive_backend |
| 188 } // namespace sync_file_system | 188 } // namespace sync_file_system |
| OLD | NEW |