| 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_test_helper.h" | 5 #include "webkit/fileapi/file_system_test_helper.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 FileSystemTestOriginHelper::~FileSystemTestOriginHelper() { | 32 FileSystemTestOriginHelper::~FileSystemTestOriginHelper() { |
| 33 } | 33 } |
| 34 | 34 |
| 35 void FileSystemTestOriginHelper::SetUp( | 35 void FileSystemTestOriginHelper::SetUp( |
| 36 const FilePath& base_dir, FileSystemFileUtil* file_util) { | 36 const FilePath& base_dir, FileSystemFileUtil* file_util) { |
| 37 SetUp(base_dir, false, false, NULL, file_util); | 37 SetUp(base_dir, false, false, NULL, file_util); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void FileSystemTestOriginHelper::SetUp( | 40 void FileSystemTestOriginHelper::SetUp( |
| 41 FileSystemContext* file_system_context, | 41 FileSystemContext* file_system_context, FileSystemFileUtil* file_util) { |
| 42 FileSystemFileUtil* file_util) { | |
| 43 DCHECK(file_system_context->path_manager()); | 42 DCHECK(file_system_context->path_manager()); |
| 44 DCHECK(file_system_context->path_manager()->sandbox_provider()); | 43 DCHECK(file_system_context->path_manager()->sandbox_provider()); |
| 45 | 44 |
| 46 file_util_ = file_util; | 45 file_util_ = file_util; |
| 47 file_system_context_ = file_system_context; | 46 file_system_context_ = file_system_context; |
| 48 if (!file_util_) | 47 if (!file_util_) |
| 49 file_util_ = file_system_context->path_manager()->sandbox_provider()-> | 48 file_util_ = file_system_context->path_manager()->sandbox_provider()-> |
| 50 GetFileSystemFileUtil(); | 49 GetFileUtil(); |
| 51 DCHECK(file_util_); | 50 DCHECK(file_util_); |
| 52 | 51 |
| 53 // Prepare the origin's root directory. | 52 // Prepare the origin's root directory. |
| 54 file_system_context_->path_manager()-> | 53 file_system_context_->path_manager()-> |
| 55 ValidateFileSystemRootAndGetPathOnFileThread( | 54 ValidateFileSystemRootAndGetPathOnFileThread( |
| 56 origin_, type_, FilePath(), true /* create */); | 55 origin_, type_, FilePath(), true /* create */); |
| 57 | 56 |
| 58 // Initialize the usage cache file. | 57 // Initialize the usage cache file. |
| 59 FilePath usage_cache_path = file_system_context_->path_manager() | 58 FilePath usage_cache_path = file_system_context_->path_manager() |
| 60 ->sandbox_provider()->GetUsageCachePathForOriginAndType(origin_, type_); | 59 ->sandbox_provider()->GetUsageCachePathForOriginAndType(origin_, type_); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 void FileSystemTestOriginHelper::InitializeOperationContext( | 171 void FileSystemTestOriginHelper::InitializeOperationContext( |
| 173 FileSystemOperationContext* context) { | 172 FileSystemOperationContext* context) { |
| 174 DCHECK(context); | 173 DCHECK(context); |
| 175 context->set_src_origin_url(origin_); | 174 context->set_src_origin_url(origin_); |
| 176 context->set_src_type(type_); | 175 context->set_src_type(type_); |
| 177 context->set_dest_origin_url(origin_); | 176 context->set_dest_origin_url(origin_); |
| 178 context->set_dest_type(type_); | 177 context->set_dest_type(type_); |
| 179 } | 178 } |
| 180 | 179 |
| 181 } // namespace fileapi | 180 } // namespace fileapi |
| OLD | NEW |