| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return GURL(url + "/"); | 148 return GURL(url + "/"); |
| 149 case kFileSystemTypeExternal: | 149 case kFileSystemTypeExternal: |
| 150 url += (kExternalDir + 1); // We don't want the leading slash. | 150 url += (kExternalDir + 1); // We don't want the leading slash. |
| 151 return GURL(url + "/"); | 151 return GURL(url + "/"); |
| 152 case kFileSystemTypeIsolated: | 152 case kFileSystemTypeIsolated: |
| 153 url += (kIsolatedDir + 1); // We don't want the leading slash. | 153 url += (kIsolatedDir + 1); // We don't want the leading slash. |
| 154 return GURL(url + "/"); | 154 return GURL(url + "/"); |
| 155 case kFileSystemTypeTest: | 155 case kFileSystemTypeTest: |
| 156 url += (kTestDir + 1); // We don't want the leading slash. | 156 url += (kTestDir + 1); // We don't want the leading slash. |
| 157 return GURL(url + "/"); | 157 return GURL(url + "/"); |
| 158 // Internal types are always pointed via isolated or external URLs. |
| 159 case kFileSystemTypeDeviceMedia: |
| 160 case kFileSystemTypeDragged: |
| 161 case kFileSystemTypeDrive: |
| 162 case kFileSystemTypeNativeLocal: |
| 163 case kFileSystemTypeNativeMedia: |
| 158 case kFileSystemTypeUnknown: | 164 case kFileSystemTypeUnknown: |
| 159 case kFileSystemTypeDragged: | |
| 160 case kFileSystemTypeNativeMedia: | |
| 161 case kFileSystemTypeDeviceMedia: | |
| 162 NOTREACHED(); | 165 NOTREACHED(); |
| 163 } | 166 } |
| 164 NOTREACHED(); | 167 NOTREACHED(); |
| 165 return GURL(); | 168 return GURL(); |
| 166 } | 169 } |
| 167 | 170 |
| 168 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) { | 171 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) { |
| 169 std::string origin_identifier = GetOriginIdentifierFromURL(origin_url); | 172 std::string origin_identifier = GetOriginIdentifierFromURL(origin_url); |
| 170 std::string type_string = GetFileSystemTypeString(type); | 173 std::string type_string = GetFileSystemTypeString(type); |
| 171 DCHECK(!type_string.empty()); | 174 DCHECK(!type_string.empty()); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 314 |
| 312 *filesystem_id = filesystem_name.substr(pos + start_token.length(), | 315 *filesystem_id = filesystem_name.substr(pos + start_token.length(), |
| 313 std::string::npos); | 316 std::string::npos); |
| 314 if (filesystem_id->empty()) | 317 if (filesystem_id->empty()) |
| 315 return false; | 318 return false; |
| 316 | 319 |
| 317 return true; | 320 return true; |
| 318 } | 321 } |
| 319 | 322 |
| 320 } // namespace fileapi | 323 } // namespace fileapi |
| OLD | NEW |