| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 *file_path, | 53 *file_path, |
| 54 &name); | 54 &name); |
| 55 ASSERT_TRUE(!fsid.empty()); | 55 ASSERT_TRUE(!fsid.empty()); |
| 56 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( | 56 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( |
| 57 fsid).AppendASCII(name); | 57 fsid).AppendASCII(name); |
| 58 *file_url = file_system_context_->CreateCrackedFileSystemURL( | 58 *file_url = file_system_context_->CreateCrackedFileSystemURL( |
| 59 GURL("http://foo"), storage::kFileSystemTypeIsolated, virtual_path); | 59 GURL("http://foo"), storage::kFileSystemTypeIsolated, virtual_path); |
| 60 } | 60 } |
| 61 | 61 |
| 62 std::unique_ptr<storage::FileSystemOperationContext> NewOperationContext() { | 62 std::unique_ptr<storage::FileSystemOperationContext> NewOperationContext() { |
| 63 return base::WrapUnique( | 63 return base::MakeUnique<storage::FileSystemOperationContext>( |
| 64 new storage::FileSystemOperationContext(file_system_context_.get())); | 64 file_system_context_.get()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 storage::FileSystemFileUtil* file_util() { | 67 storage::FileSystemFileUtil* file_util() { |
| 68 return transient_file_util_.get(); | 68 return transient_file_util_.get(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 base::MessageLoop message_loop_; | 72 base::MessageLoop message_loop_; |
| 73 base::ScopedTempDir data_dir_; | 73 base::ScopedTempDir data_dir_; |
| 74 scoped_refptr<storage::FileSystemContext> file_system_context_; | 74 scoped_refptr<storage::FileSystemContext> file_system_context_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 base::RunLoop().RunUntilIdle(); | 113 base::RunLoop().RunUntilIdle(); |
| 114 | 114 |
| 115 // Now the temporary file and the transient filesystem must be gone too. | 115 // Now the temporary file and the transient filesystem must be gone too. |
| 116 ASSERT_FALSE(base::PathExists(temp_path)); | 116 ASSERT_FALSE(base::PathExists(temp_path)); |
| 117 ASSERT_EQ(base::File::FILE_ERROR_NOT_FOUND, | 117 ASSERT_EQ(base::File::FILE_ERROR_NOT_FOUND, |
| 118 file_util()->GetFileInfo(NewOperationContext().get(), | 118 file_util()->GetFileInfo(NewOperationContext().get(), |
| 119 temp_url, &file_info, &path)); | 119 temp_url, &file_info, &path)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace content | 122 } // namespace content |
| OLD | NEW |