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/browser/fileapi/obfuscated_file_util.h" | 5 #include "webkit/browser/fileapi/obfuscated_file_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 } | 1227 } |
1228 | 1228 |
1229 std::string ObfuscatedFileUtil::GetDirectoryDatabaseKey( | 1229 std::string ObfuscatedFileUtil::GetDirectoryDatabaseKey( |
1230 const GURL& origin, FileSystemType type) { | 1230 const GURL& origin, FileSystemType type) { |
1231 std::string type_string = GetFileSystemTypeString(type); | 1231 std::string type_string = GetFileSystemTypeString(type); |
1232 if (type_string.empty()) { | 1232 if (type_string.empty()) { |
1233 LOG(WARNING) << "Unknown filesystem type requested:" << type; | 1233 LOG(WARNING) << "Unknown filesystem type requested:" << type; |
1234 return std::string(); | 1234 return std::string(); |
1235 } | 1235 } |
1236 // For isolated origin we just use a type string as a key. | 1236 // For isolated origin we just use a type string as a key. |
1237 if (special_storage_policy_ && | 1237 if (special_storage_policy_.get() && |
1238 special_storage_policy_->HasIsolatedStorage(origin)) { | 1238 special_storage_policy_->HasIsolatedStorage(origin)) { |
1239 return type_string; | 1239 return type_string; |
1240 } | 1240 } |
1241 return UTF16ToUTF8(webkit_base::GetOriginIdentifierFromURL(origin)) + | 1241 return UTF16ToUTF8(webkit_base::GetOriginIdentifierFromURL(origin)) + |
1242 type_string; | 1242 type_string; |
1243 } | 1243 } |
1244 | 1244 |
1245 // TODO(ericu): How to do the whole validation-without-creation thing? | 1245 // TODO(ericu): How to do the whole validation-without-creation thing? |
1246 // We may not have quota even to create the database. | 1246 // We may not have quota even to create the database. |
1247 // Ah, in that case don't even get here? | 1247 // Ah, in that case don't even get here? |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 // If truncating we need to update the usage. | 1495 // If truncating we need to update the usage. |
1496 if (error == base::PLATFORM_FILE_OK && delta) { | 1496 if (error == base::PLATFORM_FILE_OK && delta) { |
1497 UpdateUsage(context, url, delta); | 1497 UpdateUsage(context, url, delta); |
1498 context->change_observers()->Notify( | 1498 context->change_observers()->Notify( |
1499 &FileChangeObserver::OnModifyFile, MakeTuple(url)); | 1499 &FileChangeObserver::OnModifyFile, MakeTuple(url)); |
1500 } | 1500 } |
1501 return error; | 1501 return error; |
1502 } | 1502 } |
1503 | 1503 |
1504 } // namespace fileapi | 1504 } // namespace fileapi |
OLD | NEW |