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

Side by Side Diff: base/files/file_path.cc

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing tsepez's comments Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 StringType copy = path_; 1273 StringType copy = path_;
1274 for (size_t i = 1; i < kSeparatorsLength; ++i) { 1274 for (size_t i = 1; i < kSeparatorsLength; ++i) {
1275 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); 1275 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]);
1276 } 1276 }
1277 return FilePath(copy); 1277 return FilePath(copy);
1278 #else 1278 #else
1279 return *this; 1279 return *this;
1280 #endif 1280 #endif
1281 } 1281 }
1282 1282
1283 #if defined(OS_ANDROID)
1284 bool FilePath::IsContentUri() const {
1285 std::string content_scheme = "content://";
1286 size_t len = content_scheme.length();
1287 return path_.length() > len &&
1288 StartsWithASCII(path_, "content://", false /*case_sensitive*/) &&
1289 ((path_[len] >= L'A' && path_[len] <= L'Z') ||
jar (doing other things) 2013/11/13 01:03:28 Why do you care if the path (authority?) begins wi
qinmin 2013/11/13 23:42:43 Done, removed the path check.
1290 (path_[len] >= L'a' && path_[len] <= L'z'));
1291 }
1292 #endif
1293
1283 } // namespace base 1294 } // namespace base
1284 1295
1285 void PrintTo(const base::FilePath& path, std::ostream* out) { 1296 void PrintTo(const base::FilePath& path, std::ostream* out) {
1286 *out << path.value(); 1297 *out << path.value();
1287 } 1298 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698