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

Side by Side Diff: chrome/browser/extensions/extension_test_notification_observer.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 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 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 "chrome/browser/extensions/extension_test_notification_observer.h" 5 #include "chrome/browser/extensions/extension_test_notification_observer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/callback_list.h" 9 #include "base/callback_list.h"
10 #include "chrome/browser/extensions/extension_action_test_util.h" 10 #include "chrome/browser/extensions/extension_action_test_util.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 const ConditionCallback& condition, 277 const ConditionCallback& condition,
278 NotificationSet* notification_set) { 278 NotificationSet* notification_set) {
279 if (condition.Run()) 279 if (condition.Run())
280 return; 280 return;
281 condition_ = condition; 281 condition_ = condition;
282 282
283 scoped_refptr<content::MessageLoopRunner> runner( 283 scoped_refptr<content::MessageLoopRunner> runner(
284 new content::MessageLoopRunner); 284 new content::MessageLoopRunner);
285 quit_closure_ = runner->QuitClosure(); 285 quit_closure_ = runner->QuitClosure();
286 286
287 scoped_ptr<base::CallbackList<void()>::Subscription> subscription; 287 std::unique_ptr<base::CallbackList<void()>::Subscription> subscription;
288 if (notification_set) { 288 if (notification_set) {
289 subscription = notification_set->callback_list().Add( 289 subscription = notification_set->callback_list().Add(
290 base::Bind(&ExtensionTestNotificationObserver::MaybeQuit, 290 base::Bind(&ExtensionTestNotificationObserver::MaybeQuit,
291 base::Unretained(this))); 291 base::Unretained(this)));
292 } 292 }
293 runner->Run(); 293 runner->Run();
294 294
295 condition_.Reset(); 295 condition_.Reset();
296 quit_closure_.Reset(); 296 quit_closure_.Reset();
297 } 297 }
298 298
299 void ExtensionTestNotificationObserver::MaybeQuit() { 299 void ExtensionTestNotificationObserver::MaybeQuit() {
300 if (condition_.Run()) 300 if (condition_.Run())
301 quit_closure_.Run(); 301 quit_closure_.Run();
302 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698