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

Side by Side Diff: webkit/fileapi/file_system_util.cc

Issue 11833002: Cleanup: Add fileapi::GetIsolatedFileSystemRootURIString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | 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 "webkit/fileapi/file_system_util.h" 5 #include "webkit/fileapi/file_system_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return false; 266 return false;
267 267
268 *filesystem_id = filesystem_name.substr(pos + start_token.length(), 268 *filesystem_id = filesystem_name.substr(pos + start_token.length(),
269 std::string::npos); 269 std::string::npos);
270 if (filesystem_id->empty()) 270 if (filesystem_id->empty())
271 return false; 271 return false;
272 272
273 return true; 273 return true;
274 } 274 }
275 275
276 std::string GetIsolatedFileSystemRootURIString(
277 const GURL& origin_url,
278 const std::string& filesystem_id,
279 const std::string& optional_root_name) {
280 std::string root = GetFileSystemRootURI(origin_url,
281 kFileSystemTypeIsolated).spec();
282 root.append(filesystem_id);
283 root.append("/");
284 if (!optional_root_name.empty()) {
285 DCHECK(!FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent());
286 root.append(optional_root_name);
287 root.append("/");
288 }
289 return root;
290 }
291
276 } // namespace fileapi 292 } // namespace fileapi
OLDNEW
« webkit/fileapi/file_system_util.h ('K') | « webkit/fileapi/file_system_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698