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

Side by Side Diff: chrome/browser/browsing_data/media_licenses_counter_browsertest.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/browsing_data/media_licenses_counter.h" 5 #include "chrome/browser/browsing_data/media_licenses_counter.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 const GURL& origin, 112 const GURL& origin,
113 const std::string& fsid, 113 const std::string& fsid,
114 const std::string& file_name) { 114 const std::string& file_name) {
115 std::string root = storage::GetIsolatedFileSystemRootURIString( 115 std::string root = storage::GetIsolatedFileSystemRootURIString(
116 origin, fsid, ppapi::kPluginPrivateRootName); 116 origin, fsid, ppapi::kPluginPrivateRootName);
117 storage::FileSystemURL file_url = 117 storage::FileSystemURL file_url =
118 filesystem_context->CrackURL(GURL(root + file_name)); 118 filesystem_context->CrackURL(GURL(root + file_name));
119 storage::AsyncFileUtil* file_util = filesystem_context->GetAsyncFileUtil( 119 storage::AsyncFileUtil* file_util = filesystem_context->GetAsyncFileUtil(
120 storage::kFileSystemTypePluginPrivate); 120 storage::kFileSystemTypePluginPrivate);
121 std::unique_ptr<storage::FileSystemOperationContext> operation_context = 121 std::unique_ptr<storage::FileSystemOperationContext> operation_context =
122 base::WrapUnique( 122 base::MakeUnique<storage::FileSystemOperationContext>(
123 new storage::FileSystemOperationContext(filesystem_context)); 123 filesystem_context);
124 operation_context->set_allowed_bytes_growth( 124 operation_context->set_allowed_bytes_growth(
125 storage::QuotaManager::kNoLimit); 125 storage::QuotaManager::kNoLimit);
126 file_util->EnsureFileExists( 126 file_util->EnsureFileExists(
127 std::move(operation_context), file_url, 127 std::move(operation_context), file_url,
128 base::Bind(&MediaLicensesCounterTest::OnFileCreated, 128 base::Bind(&MediaLicensesCounterTest::OnFileCreated,
129 base::Unretained(this))); 129 base::Unretained(this)));
130 RunAndWaitForResult(); 130 RunAndWaitForResult();
131 } 131 }
132 132
133 void OnFileSystemOpened(base::File::Error result) { 133 void OnFileSystemOpened(base::File::Error result) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 SetMediaLicenseDeletionPref(true); 212 SetMediaLicenseDeletionPref(true);
213 213
214 RunAndWaitForResult(); 214 RunAndWaitForResult();
215 215
216 EXPECT_TRUE(CallbackCalled()); 216 EXPECT_TRUE(CallbackCalled());
217 EXPECT_EQ(0u, GetCount()); 217 EXPECT_EQ(0u, GetCount());
218 EXPECT_TRUE(GetOrigin().empty()); 218 EXPECT_TRUE(GetOrigin().empty());
219 } 219 }
220 220
221 } // namespace 221 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/media_licenses_counter.cc ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698