Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: webkit/fileapi/file_system_operation.cc

Issue 9370045: Fixed bug: we can now handle "a:b" as a file name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_directory_database.cc ('k') | webkit/fileapi/file_system_operation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698