| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 if (!VerifyFileSystemPathForRead(path, &origin_url, &type, &virtual_path, | 378 if (!VerifyFileSystemPathForRead(path, &origin_url, &type, &virtual_path, |
| 379 &file_util)) { | 379 &file_util)) { |
| 380 delete this; | 380 delete this; |
| 381 return; | 381 return; |
| 382 } | 382 } |
| 383 file_system_operation_context_.set_src_origin_url(origin_url); | 383 file_system_operation_context_.set_src_origin_url(origin_url); |
| 384 file_system_operation_context_.set_src_type(type); | 384 file_system_operation_context_.set_src_type(type); |
| 385 if (!file_system_operation_context_.src_file_util()) | 385 if (!file_system_operation_context_.src_file_util()) |
| 386 file_system_operation_context_.set_src_file_util(file_util); | 386 file_system_operation_context_.set_src_file_util(file_util); |
| 387 FileSystemFileUtilProxy::ReadDirectory( | 387 FileSystemFileUtilProxy::ReadDirectory( |
| 388 file_system_operation_context_, | 388 file_system_operation_context_, proxy_, virtual_path, |
| 389 proxy_, virtual_path, callback_factory_.NewCallback( | 389 base::Bind(&FileSystemOperation::DidReadDirectory, |
| 390 &FileSystemOperation::DidReadDirectory)); | 390 weak_factory_.GetWeakPtr())); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void FileSystemOperation::Remove(const GURL& path, bool recursive) { | 393 void FileSystemOperation::Remove(const GURL& path, bool recursive) { |
| 394 #ifndef NDEBUG | 394 #ifndef NDEBUG |
| 395 DCHECK(kOperationNone == pending_operation_); | 395 DCHECK(kOperationNone == pending_operation_); |
| 396 pending_operation_ = kOperationRemove; | 396 pending_operation_ = kOperationRemove; |
| 397 #endif | 397 #endif |
| 398 | 398 |
| 399 FilePath virtual_path; | 399 FilePath virtual_path; |
| 400 GURL origin_url; | 400 GURL origin_url; |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 return false; | 893 return false; |
| 894 } | 894 } |
| 895 DCHECK(file_util); | 895 DCHECK(file_util); |
| 896 *file_util = file_system_context()->path_manager()->GetFileUtil(*type); | 896 *file_util = file_system_context()->path_manager()->GetFileUtil(*type); |
| 897 DCHECK(*file_util); | 897 DCHECK(*file_util); |
| 898 | 898 |
| 899 return true; | 899 return true; |
| 900 } | 900 } |
| 901 | 901 |
| 902 } // namespace fileapi | 902 } // namespace fileapi |
| OLD | NEW |