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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 return NULL; | 1160 return NULL; |
1161 } | 1161 } |
1162 MarkUsed(); | 1162 MarkUsed(); |
1163 SandboxDirectoryDatabase* database = new SandboxDirectoryDatabase(path); | 1163 SandboxDirectoryDatabase* database = new SandboxDirectoryDatabase(path); |
1164 directories_[key] = database; | 1164 directories_[key] = database; |
1165 return database; | 1165 return database; |
1166 } | 1166 } |
1167 | 1167 |
1168 base::FilePath ObfuscatedFileUtil::GetDirectoryForOrigin( | 1168 base::FilePath ObfuscatedFileUtil::GetDirectoryForOrigin( |
1169 const GURL& origin, bool create, base::PlatformFileError* error_code) { | 1169 const GURL& origin, bool create, base::PlatformFileError* error_code) { |
1170 if (special_storage_policy_ && | 1170 if (special_storage_policy_.get() && |
1171 special_storage_policy_->HasIsolatedStorage(origin)) { | 1171 special_storage_policy_->HasIsolatedStorage(origin)) { |
1172 CHECK(isolated_origin_.is_empty() || isolated_origin_ == origin) | 1172 CHECK(isolated_origin_.is_empty() || isolated_origin_ == origin) |
1173 << "multiple origins for an isolated site: " | 1173 << "multiple origins for an isolated site: " |
1174 << isolated_origin_.spec() << " vs " << origin.spec(); | 1174 << isolated_origin_.spec() << " vs " << origin.spec(); |
1175 isolated_origin_ = origin; | 1175 isolated_origin_ = origin; |
1176 } | 1176 } |
1177 | 1177 |
1178 if (!InitOriginDatabase(create)) { | 1178 if (!InitOriginDatabase(create)) { |
1179 if (error_code) { | 1179 if (error_code) { |
1180 *error_code = create ? | 1180 *error_code = create ? |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 // If truncating we need to update the usage. | 1383 // If truncating we need to update the usage. |
1384 if (error == base::PLATFORM_FILE_OK && delta) { | 1384 if (error == base::PLATFORM_FILE_OK && delta) { |
1385 UpdateUsage(context, url, delta); | 1385 UpdateUsage(context, url, delta); |
1386 context->change_observers()->Notify( | 1386 context->change_observers()->Notify( |
1387 &FileChangeObserver::OnModifyFile, MakeTuple(url)); | 1387 &FileChangeObserver::OnModifyFile, MakeTuple(url)); |
1388 } | 1388 } |
1389 return error; | 1389 return error; |
1390 } | 1390 } |
1391 | 1391 |
1392 } // namespace fileapi | 1392 } // namespace fileapi |
OLD | NEW |