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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
18 #include "webkit/base/origin_url_conversions.h" | 18 #include "webkit/base/origin_url_conversions.h" |
19 #include "webkit/fileapi/file_system_url.h" | |
20 | 19 |
21 namespace fileapi { | 20 namespace fileapi { |
22 | 21 |
23 const char kPersistentDir[] = "/persistent"; | 22 const char kPersistentDir[] = "/persistent"; |
24 const char kTemporaryDir[] = "/temporary"; | 23 const char kTemporaryDir[] = "/temporary"; |
25 const char kIsolatedDir[] = "/isolated"; | 24 const char kIsolatedDir[] = "/isolated"; |
26 const char kExternalDir[] = "/external"; | 25 const char kExternalDir[] = "/external"; |
27 const char kTestDir[] = "/test"; | 26 const char kTestDir[] = "/test"; |
28 | 27 |
29 const base::FilePath::CharType VirtualPath::kRoot[] = FILE_PATH_LITERAL("/"); | 28 const base::FilePath::CharType VirtualPath::kRoot[] = FILE_PATH_LITERAL("/"); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 root.append("/"); | 351 root.append("/"); |
353 if (!optional_root_name.empty()) { | 352 if (!optional_root_name.empty()) { |
354 if (base::FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent()) | 353 if (base::FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent()) |
355 return std::string(); | 354 return std::string(); |
356 root.append(optional_root_name); | 355 root.append(optional_root_name); |
357 root.append("/"); | 356 root.append("/"); |
358 } | 357 } |
359 return root; | 358 return root; |
360 } | 359 } |
361 | 360 |
362 bool AreSameFileSystem(const FileSystemURL& url1, const FileSystemURL& url2) { | |
363 return url1.origin() == url2.origin() && url1.type() == url2.type(); | |
364 } | |
365 | |
366 } // namespace fileapi | 361 } // namespace fileapi |
OLD | NEW |