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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 operation_context_.set_src_type(type); | 779 operation_context_.set_src_type(type); |
780 if (!operation_context_.src_file_util()) | 780 if (!operation_context_.src_file_util()) |
781 operation_context_.set_src_file_util(file_util); | 781 operation_context_.set_src_file_util(file_util); |
782 return result; | 782 return result; |
783 } | 783 } |
784 | 784 |
785 bool FileSystemOperation::SetupSrcContextForWrite(const GURL& path, | 785 bool FileSystemOperation::SetupSrcContextForWrite(const GURL& path, |
786 bool create) { | 786 bool create) { |
787 GURL origin_url; | 787 GURL origin_url; |
788 FileSystemType type; | 788 FileSystemType type; |
789 FileSystemFileUtil* file_util; | 789 FileSystemFileUtil* file_util = NULL; |
790 bool result = VerifyFileSystemPathForWrite( | 790 bool result = VerifyFileSystemPathForWrite( |
791 path, create, &origin_url, &type, &src_virtual_path_, &file_util); | 791 path, create, &origin_url, &type, &src_virtual_path_, &file_util); |
792 operation_context_.set_src_origin_url(origin_url); | 792 operation_context_.set_src_origin_url(origin_url); |
793 operation_context_.set_src_type(type); | 793 operation_context_.set_src_type(type); |
794 if (!operation_context_.src_file_util()) | 794 if (!operation_context_.src_file_util()) |
795 operation_context_.set_src_file_util(file_util); | 795 operation_context_.set_src_file_util(file_util); |
796 return result; | 796 return result; |
797 } | 797 } |
798 | 798 |
799 bool FileSystemOperation::SetupDestContextForWrite(const GURL& path, | 799 bool FileSystemOperation::SetupDestContextForWrite(const GURL& path, |
800 bool create) { | 800 bool create) { |
801 GURL origin_url; | 801 GURL origin_url; |
802 FileSystemType type; | 802 FileSystemType type; |
803 FileSystemFileUtil* file_util; | 803 FileSystemFileUtil* file_util = NULL; |
804 bool result = VerifyFileSystemPathForWrite( | 804 bool result = VerifyFileSystemPathForWrite( |
805 path, create, &origin_url, &type, &dest_virtual_path_, &file_util); | 805 path, create, &origin_url, &type, &dest_virtual_path_, &file_util); |
806 operation_context_.set_dest_origin_url(origin_url); | 806 operation_context_.set_dest_origin_url(origin_url); |
807 operation_context_.set_dest_type(type); | 807 operation_context_.set_dest_type(type); |
808 if (!operation_context_.dest_file_util()) | 808 if (!operation_context_.dest_file_util()) |
809 operation_context_.set_dest_file_util(file_util); | 809 operation_context_.set_dest_file_util(file_util); |
810 return result; | 810 return result; |
811 } | 811 } |
812 | 812 |
813 } // namespace fileapi | 813 } // namespace fileapi |
OLD | NEW |