| 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 return error; | 1096 return error; |
| 1097 | 1097 |
| 1098 bool created = false; | 1098 bool created = false; |
| 1099 if (!src_file_path.empty()) { | 1099 if (!src_file_path.empty()) { |
| 1100 DCHECK(!file_flags); | 1100 DCHECK(!file_flags); |
| 1101 DCHECK(!handle); | 1101 DCHECK(!handle); |
| 1102 error = NativeFileUtil::CopyOrMoveFile( | 1102 error = NativeFileUtil::CopyOrMoveFile( |
| 1103 src_file_path, dest_local_path, true /* copy */); | 1103 src_file_path, dest_local_path, true /* copy */); |
| 1104 created = true; | 1104 created = true; |
| 1105 } else { | 1105 } else { |
| 1106 if (file_util::PathExists(dest_local_path)) { | 1106 if (base::PathExists(dest_local_path)) { |
| 1107 if (!base::Delete(dest_local_path, true /* recursive */)) { | 1107 if (!base::Delete(dest_local_path, true /* recursive */)) { |
| 1108 NOTREACHED(); | 1108 NOTREACHED(); |
| 1109 return base::PLATFORM_FILE_ERROR_FAILED; | 1109 return base::PLATFORM_FILE_ERROR_FAILED; |
| 1110 } | 1110 } |
| 1111 LOG(WARNING) << "A stray file detected"; | 1111 LOG(WARNING) << "A stray file detected"; |
| 1112 InvalidateUsageCache(context, dest_origin, dest_type); | 1112 InvalidateUsageCache(context, dest_origin, dest_type); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 if (handle) { | 1115 if (handle) { |
| 1116 error = NativeFileUtil::CreateOrOpen( | 1116 error = NativeFileUtil::CreateOrOpen( |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 // special_storage_policy_->HasIsolatedStorage(origin) returns false | 1446 // special_storage_policy_->HasIsolatedStorage(origin) returns false |
| 1447 // for the same origin. | 1447 // for the same origin. |
| 1448 if (!isolated_origin_.is_empty()) { | 1448 if (!isolated_origin_.is_empty()) { |
| 1449 CHECK_EQ(isolated_origin_.spec(), origin.spec()); | 1449 CHECK_EQ(isolated_origin_.spec(), origin.spec()); |
| 1450 return true; | 1450 return true; |
| 1451 } | 1451 } |
| 1452 return false; | 1452 return false; |
| 1453 } | 1453 } |
| 1454 | 1454 |
| 1455 } // namespace fileapi | 1455 } // namespace fileapi |
| OLD | NEW |