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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( | 52 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( |
53 fsid).AppendASCII(name); | 53 fsid).AppendASCII(name); |
54 *file_url = file_system_context_->CreateCrackedFileSystemURL( | 54 *file_url = file_system_context_->CreateCrackedFileSystemURL( |
55 GURL("http://foo"), | 55 GURL("http://foo"), |
56 kFileSystemTypeIsolated, | 56 kFileSystemTypeIsolated, |
57 virtual_path); | 57 virtual_path); |
58 } | 58 } |
59 | 59 |
60 scoped_ptr<FileSystemOperationContext> NewOperationContext() { | 60 scoped_ptr<FileSystemOperationContext> NewOperationContext() { |
61 return make_scoped_ptr( | 61 return make_scoped_ptr( |
62 new FileSystemOperationContext(file_system_context_)); | 62 new FileSystemOperationContext(file_system_context_.get())); |
63 } | 63 } |
64 | 64 |
65 FileSystemFileUtil* file_util() { return transient_file_util_.get(); } | 65 FileSystemFileUtil* file_util() { return transient_file_util_.get(); } |
66 | 66 |
67 private: | 67 private: |
68 base::MessageLoop message_loop_; | 68 base::MessageLoop message_loop_; |
69 base::ScopedTempDir data_dir_; | 69 base::ScopedTempDir data_dir_; |
70 scoped_refptr<FileSystemContext> file_system_context_; | 70 scoped_refptr<FileSystemContext> file_system_context_; |
71 scoped_ptr<TransientFileUtil> transient_file_util_; | 71 scoped_ptr<TransientFileUtil> transient_file_util_; |
72 | 72 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 base::MessageLoop::current()->RunUntilIdle(); | 113 base::MessageLoop::current()->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(file_util::PathExists(temp_path)); | 116 ASSERT_FALSE(file_util::PathExists(temp_path)); |
117 ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, | 117 ASSERT_EQ(base::PLATFORM_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 fileapi | 122 } // namespace fileapi |
OLD | NEW |