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

Side by Side Diff: storage/browser/fileapi/file_system_url.cc

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android 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
« no previous file with comments | « ppapi/shared_impl/var.cc ('k') | third_party/boringssl/boringssl_unittest.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/browser/fileapi/file_system_url.h" 5 #include "storage/browser/fileapi/file_system_url.h"
6 6
7 #include <sstream> 7 #include <sstream>
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 std::string url = GetFileSystemRootURI(origin_, mount_type_).spec(); 104 std::string url = GetFileSystemRootURI(origin_, mount_type_).spec();
105 if (url.empty()) 105 if (url.empty())
106 return GURL(); 106 return GURL();
107 107
108 // Exactly match with DOMFileSystemBase::createFileSystemURL()'s encoding 108 // Exactly match with DOMFileSystemBase::createFileSystemURL()'s encoding
109 // behavior, where the path is escaped by KURL::encodeWithURLEscapeSequences 109 // behavior, where the path is escaped by KURL::encodeWithURLEscapeSequences
110 // which is essentially encodeURIComponent except '/'. 110 // which is essentially encodeURIComponent except '/'.
111 std::string escaped = net::EscapeQueryParamValue( 111 std::string escaped = net::EscapeQueryParamValue(
112 virtual_path_.NormalizePathSeparatorsTo('/').AsUTF8Unsafe(), 112 virtual_path_.NormalizePathSeparatorsTo('/').AsUTF8Unsafe(),
113 false /* use_plus */); 113 false /* use_plus */);
114 ReplaceSubstringsAfterOffset(&escaped, 0, "%2F", "/"); 114 base::ReplaceSubstringsAfterOffset(&escaped, 0, "%2F", "/");
115 url.append(escaped); 115 url.append(escaped);
116 116
117 // Build nested GURL. 117 // Build nested GURL.
118 return GURL(url); 118 return GURL(url);
119 } 119 }
120 120
121 std::string FileSystemURL::DebugString() const { 121 std::string FileSystemURL::DebugString() const {
122 if (!is_valid_) 122 if (!is_valid_)
123 return "invalid filesystem: URL"; 123 return "invalid filesystem: URL";
124 std::ostringstream ss; 124 std::ostringstream ss;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 if (lhs.origin_ != rhs.origin_) 162 if (lhs.origin_ != rhs.origin_)
163 return lhs.origin_ < rhs.origin_; 163 return lhs.origin_ < rhs.origin_;
164 if (lhs.type_ != rhs.type_) 164 if (lhs.type_ != rhs.type_)
165 return lhs.type_ < rhs.type_; 165 return lhs.type_ < rhs.type_;
166 if (lhs.filesystem_id_ != rhs.filesystem_id_) 166 if (lhs.filesystem_id_ != rhs.filesystem_id_)
167 return lhs.filesystem_id_ < rhs.filesystem_id_; 167 return lhs.filesystem_id_ < rhs.filesystem_id_;
168 return lhs.path_ < rhs.path_; 168 return lhs.path_ < rhs.path_;
169 } 169 }
170 170
171 } // namespace storage 171 } // namespace storage
OLDNEW
« no previous file with comments | « ppapi/shared_impl/var.cc ('k') | third_party/boringssl/boringssl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698