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

Side by Side Diff: extensions/browser/test_extension_registry_observer.cc

Issue 1909773002: Convert //extensions/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/test_extension_registry_observer.h" 5 #include "extensions/browser/test_extension_registry_observer.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "extensions/browser/extension_registry.h" 9 #include "extensions/browser/extension_registry.h"
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 void TestExtensionRegistryObserver::OnExtensionUnloaded( 99 void TestExtensionRegistryObserver::OnExtensionUnloaded(
100 content::BrowserContext* browser_context, 100 content::BrowserContext* browser_context,
101 const Extension* extension, 101 const Extension* extension,
102 UnloadedExtensionInfo::Reason reason) { 102 UnloadedExtensionInfo::Reason reason) {
103 if (extension_id_.empty() || extension->id() == extension_id_) 103 if (extension_id_.empty() || extension->id() == extension_id_)
104 unloaded_waiter_->OnObserved(extension); 104 unloaded_waiter_->OnObserved(extension);
105 } 105 }
106 106
107 const Extension* TestExtensionRegistryObserver::Wait( 107 const Extension* TestExtensionRegistryObserver::Wait(
108 scoped_ptr<Waiter>* waiter) { 108 std::unique_ptr<Waiter>* waiter) {
109 waiter->get()->Wait(); 109 waiter->get()->Wait();
110 const Extension* extension = waiter->get()->extension(); 110 const Extension* extension = waiter->get()->extension();
111 // Reset the waiter for future uses. 111 // Reset the waiter for future uses.
112 // We could have a Waiter::Reset method, but it would reset every field in the 112 // We could have a Waiter::Reset method, but it would reset every field in the
113 // class, so let's just reset the pointer. 113 // class, so let's just reset the pointer.
114 waiter->reset(new Waiter()); 114 waiter->reset(new Waiter());
115 return extension; 115 return extension;
116 } 116 }
117 117
118 } // namespace extensions 118 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/test_extension_registry_observer.h ('k') | extensions/browser/test_extensions_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698