OLD | NEW |
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 Loading... |
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 |
OLD | NEW |