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

Side by Side Diff: storage/common/fileapi/file_system_util.cc

Issue 1280473002: Update ToLower/UpperASCII API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « net/http/http_util_unittest.cc ('k') | ui/base/ime/chromeos/input_method_descriptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "storage/common/fileapi/file_system_util.h" 5 #include "storage/common/fileapi/file_system_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 DCHECK(filesystem_id); 413 DCHECK(filesystem_id);
414 414
415 // |filesystem_name| is of the form {origin}:isolated_{filesystem_id}. 415 // |filesystem_name| is of the form {origin}:isolated_{filesystem_id}.
416 std::string start_token(":"); 416 std::string start_token(":");
417 start_token = start_token.append( 417 start_token = start_token.append(
418 GetFileSystemTypeString(kFileSystemTypeIsolated)).append("_"); 418 GetFileSystemTypeString(kFileSystemTypeIsolated)).append("_");
419 // WebKit uses different case in its constant for isolated file system 419 // WebKit uses different case in its constant for isolated file system
420 // names, so we do a case insensitive compare by converting both strings 420 // names, so we do a case insensitive compare by converting both strings
421 // to uppercase. 421 // to uppercase.
422 // TODO(benwells): Remove this when WebKit uses the same constant. 422 // TODO(benwells): Remove this when WebKit uses the same constant.
423 start_token = base::StringToUpperASCII(start_token); 423 start_token = base::ToUpperASCII(start_token);
424 std::string filesystem_name_upper = base::StringToUpperASCII(filesystem_name); 424 std::string filesystem_name_upper = base::ToUpperASCII(filesystem_name);
425 size_t pos = filesystem_name_upper.find(start_token); 425 size_t pos = filesystem_name_upper.find(start_token);
426 if (pos == std::string::npos) 426 if (pos == std::string::npos)
427 return false; 427 return false;
428 if (pos == 0) 428 if (pos == 0)
429 return false; 429 return false;
430 430
431 *filesystem_id = filesystem_name.substr(pos + start_token.length(), 431 *filesystem_id = filesystem_name.substr(pos + start_token.length(),
432 std::string::npos); 432 std::string::npos);
433 if (filesystem_id->empty()) 433 if (filesystem_id->empty())
434 return false; 434 return false;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 return base::File::FILE_ERROR_ABORT; 499 return base::File::FILE_ERROR_ABORT;
500 case net::ERR_ADDRESS_INVALID: 500 case net::ERR_ADDRESS_INVALID:
501 case net::ERR_INVALID_URL: 501 case net::ERR_INVALID_URL:
502 return base::File::FILE_ERROR_INVALID_URL; 502 return base::File::FILE_ERROR_INVALID_URL;
503 default: 503 default:
504 return base::File::FILE_ERROR_FAILED; 504 return base::File::FILE_ERROR_FAILED;
505 } 505 }
506 } 506 }
507 507
508 } // namespace storage 508 } // namespace storage
OLDNEW
« no previous file with comments | « net/http/http_util_unittest.cc ('k') | ui/base/ime/chromeos/input_method_descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698