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

Unified Diff: chrome/browser/extensions/user_script_listener_unittest.cc

Issue 2846413002: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/user_script_listener_unittest.cc
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc
index ec0f81111be7873bde99530182625d8ccabdd1d4..bdc92d79777c0ee684ecaa13dbc0d182df1ee149 100644
--- a/chrome/browser/extensions/user_script_listener_unittest.cc
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc
@@ -10,6 +10,7 @@
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/threading/thread.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -184,8 +185,8 @@ class UserScriptListenerTest : public testing::Test {
bool defer = false;
if (throttle) {
- request->SetUserData(nullptr,
- new ThrottleDelegate(request.get(), throttle));
+ request->SetUserData(
+ nullptr, base::MakeUnique<ThrottleDelegate>(request.get(), throttle));
throttle->WillStartRequest(&defer);
}
@@ -358,7 +359,8 @@ TEST_F(UserScriptListenerTest, ResumeBeforeStart) {
ResourceThrottle* throttle =
listener_->CreateResourceThrottle(url, content::RESOURCE_TYPE_MAIN_FRAME);
ASSERT_TRUE(throttle);
- request->SetUserData(nullptr, new ThrottleDelegate(request.get(), throttle));
+ request->SetUserData(
+ nullptr, base::MakeUnique<ThrottleDelegate>(request.get(), throttle));
ASSERT_FALSE(request->is_pending());
« no previous file with comments | « chrome/browser/extensions/chrome_extension_web_contents_observer.h ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698