| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return quota::kStorageTypeTemporary; | 137 return quota::kStorageTypeTemporary; |
| 138 case kFileSystemTypePersistent: | 138 case kFileSystemTypePersistent: |
| 139 return quota::kStorageTypePersistent; | 139 return quota::kStorageTypePersistent; |
| 140 default: | 140 default: |
| 141 return quota::kStorageTypeUnknown; | 141 return quota::kStorageTypeUnknown; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 // TODO(kinuko): Merge these two methods (conversion methods between | 145 // TODO(kinuko): Merge these two methods (conversion methods between |
| 146 // origin url <==> identifier) with the ones in the database module. | 146 // origin url <==> identifier) with the ones in the database module. |
| 147 // http://crbug.com/116476 |
| 147 std::string GetOriginIdentifierFromURL(const GURL& url) { | 148 std::string GetOriginIdentifierFromURL(const GURL& url) { |
| 148 WebKit::WebSecurityOrigin web_security_origin = | 149 WebKit::WebSecurityOrigin web_security_origin = |
| 149 WebKit::WebSecurityOrigin::createFromString(UTF8ToUTF16(url.spec())); | 150 WebKit::WebSecurityOrigin::createFromString(UTF8ToUTF16(url.spec())); |
| 150 return web_security_origin.databaseIdentifier().utf8(); | 151 return web_security_origin.databaseIdentifier().utf8(); |
| 151 } | 152 } |
| 152 | 153 |
| 153 GURL GetOriginURLFromIdentifier(const std::string& origin_identifier) { | 154 GURL GetOriginURLFromIdentifier(const std::string& origin_identifier) { |
| 154 WebKit::WebSecurityOrigin web_security_origin = | 155 WebKit::WebSecurityOrigin web_security_origin = |
| 155 WebKit::WebSecurityOrigin::createFromDatabaseIdentifier( | 156 WebKit::WebSecurityOrigin::createFromDatabaseIdentifier( |
| 156 UTF8ToUTF16(origin_identifier)); | 157 UTF8ToUTF16(origin_identifier)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 172 return fileapi::kPersistentName; | 173 return fileapi::kPersistentName; |
| 173 case kFileSystemTypeExternal: | 174 case kFileSystemTypeExternal: |
| 174 return fileapi::kExternalName; | 175 return fileapi::kExternalName; |
| 175 case kFileSystemTypeUnknown: | 176 case kFileSystemTypeUnknown: |
| 176 default: | 177 default: |
| 177 return std::string(); | 178 return std::string(); |
| 178 } | 179 } |
| 179 } | 180 } |
| 180 | 181 |
| 181 } // namespace fileapi | 182 } // namespace fileapi |
| OLD | NEW |