Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: content/browser/fileapi/transient_file_util_unittest.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/fileapi/dragged_file_util_unittest.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698