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_operation.h" | 5 #include "webkit/fileapi/file_system_operation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 // Any write access is disallowed on the root path. | 717 // Any write access is disallowed on the root path. |
718 if (cracked_path.value().length() == 0 || | 718 if (cracked_path.value().length() == 0 || |
719 cracked_path.DirName().value() == cracked_path.value()) | 719 cracked_path.DirName().value() == cracked_path.value()) |
720 return base::PLATFORM_FILE_ERROR_SECURITY; | 720 return base::PLATFORM_FILE_ERROR_SECURITY; |
721 | 721 |
722 if (mode == PATH_FOR_CREATE) { | 722 if (mode == PATH_FOR_CREATE) { |
723 FileSystemMountPointProvider* provider = file_system_context()-> | 723 FileSystemMountPointProvider* provider = file_system_context()-> |
724 GetMountPointProvider(type); | 724 GetMountPointProvider(type); |
725 | 725 |
726 // Check if the cracked file name looks good to create. | 726 // Check if the cracked file name looks good to create. |
727 if (provider->IsRestrictedFileName(cracked_path.BaseName())) | 727 if (provider->IsRestrictedFileName(VirtualPath::BaseName(cracked_path))) |
728 return base::PLATFORM_FILE_ERROR_SECURITY; | 728 return base::PLATFORM_FILE_ERROR_SECURITY; |
729 } | 729 } |
730 | 730 |
731 return base::PLATFORM_FILE_OK; | 731 return base::PLATFORM_FILE_OK; |
732 } | 732 } |
733 | 733 |
734 bool FileSystemOperation::SetPendingOperationType(OperationType type) { | 734 bool FileSystemOperation::SetPendingOperationType(OperationType type) { |
735 if (pending_operation_ != kOperationNone) | 735 if (pending_operation_ != kOperationNone) |
736 return false; | 736 return false; |
737 pending_operation_ = type; | 737 pending_operation_ = type; |
738 return true; | 738 return true; |
739 } | 739 } |
740 | 740 |
741 } // namespace fileapi | 741 } // namespace fileapi |
OLD | NEW |