| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/fileapi/cros_mount_point_provider.h" | 5 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| 11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste
m.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste
m.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 18 #include "webkit/chromeos/fileapi/file_access_permissions.h" | 18 #include "webkit/chromeos/fileapi/file_access_permissions.h" |
| 19 #include "webkit/fileapi/file_system_path_manager.h" | |
| 20 #include "webkit/fileapi/file_system_util.h" | 19 #include "webkit/fileapi/file_system_util.h" |
| 21 #include "webkit/fileapi/native_file_util.h" | 20 #include "webkit/fileapi/native_file_util.h" |
| 22 #include "webkit/glue/webkit_glue.h" | 21 #include "webkit/glue/webkit_glue.h" |
| 23 | 22 |
| 24 namespace chromeos { | 23 namespace chromeos { |
| 25 | 24 |
| 26 typedef struct { | 25 typedef struct { |
| 27 const char* local_root_path; | 26 const char* local_root_path; |
| 28 const char* web_root_path; | 27 const char* web_root_path; |
| 29 } FixedExposedPaths; | 28 } FixedExposedPaths; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return false; | 75 return false; |
| 77 } | 76 } |
| 78 *root_path = iter->second; | 77 *root_path = iter->second; |
| 79 return true; | 78 return true; |
| 80 } | 79 } |
| 81 | 80 |
| 82 void CrosMountPointProvider::ValidateFileSystemRootAndGetURL( | 81 void CrosMountPointProvider::ValidateFileSystemRootAndGetURL( |
| 83 const GURL& origin_url, | 82 const GURL& origin_url, |
| 84 fileapi::FileSystemType type, | 83 fileapi::FileSystemType type, |
| 85 bool create, | 84 bool create, |
| 86 const fileapi::FileSystemPathManager::GetRootPathCallback& callback) { | 85 const GetRootPathCallback& callback) { |
| 87 DCHECK(type == fileapi::kFileSystemTypeExternal); | 86 DCHECK(type == fileapi::kFileSystemTypeExternal); |
| 88 std::string name(GetOriginIdentifierFromURL(origin_url)); | 87 std::string name(GetOriginIdentifierFromURL(origin_url)); |
| 89 name += ':'; | 88 name += ':'; |
| 90 name += fileapi::kExternalName; | 89 name += fileapi::kExternalName; |
| 91 FilePath root_path; | 90 FilePath root_path; |
| 92 root_path = FilePath(fileapi::kExternalDir); | 91 root_path = FilePath(fileapi::kExternalDir); |
| 93 callback.Run(true, root_path, name); | 92 callback.Run(true, root_path, name); |
| 94 } | 93 } |
| 95 | 94 |
| 96 FilePath CrosMountPointProvider::ValidateFileSystemRootAndGetPathOnFileThread( | 95 FilePath CrosMountPointProvider::ValidateFileSystemRootAndGetPathOnFileThread( |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } else if (mount_prefix == filesystem_path) { | 193 } else if (mount_prefix == filesystem_path) { |
| 195 FilePath root = FilePath(FILE_PATH_LITERAL("/")); | 194 FilePath root = FilePath(FILE_PATH_LITERAL("/")); |
| 196 *virtual_path = root.Append(iter->first); | 195 *virtual_path = root.Append(iter->first); |
| 197 return true; | 196 return true; |
| 198 } | 197 } |
| 199 } | 198 } |
| 200 return false; | 199 return false; |
| 201 } | 200 } |
| 202 | 201 |
| 203 } // namespace chromeos | 202 } // namespace chromeos |
| OLD | NEW |