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

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

Issue 503873002: Remove implicit conversions from scoped_refptr to T* in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 "content/public/test/test_utils.h" 7 #include "content/public/test/test_utils.h"
8 #include "extensions/browser/extension_registry.h" 8 #include "extensions/browser/extension_registry.h"
9 9
10 namespace extensions { 10 namespace extensions {
11 11
12 class TestExtensionRegistryObserver::Waiter { 12 class TestExtensionRegistryObserver::Waiter {
13 public: 13 public:
14 Waiter(const std::string& extension_id) : observed_(false), runner_(NULL) {} 14 Waiter(const std::string& extension_id) : observed_(false), runner_(NULL) {}
15 15
16 void Wait() { 16 void Wait() {
17 if (observed_) 17 if (observed_)
18 return; 18 return;
19 19
20 runner_ = new content::MessageLoopRunner(); 20 runner_ = new content::MessageLoopRunner();
21 runner_->Run(); 21 runner_->Run();
22 } 22 }
23 23
24 void OnObserved() { 24 void OnObserved() {
25 observed_ = true; 25 observed_ = true;
26 26
27 if (runner_) { 27 if (runner_.get()) {
28 runner_->Quit(); 28 runner_->Quit();
29 runner_ = NULL; 29 runner_ = NULL;
30 } 30 }
31 } 31 }
32 32
33 private: 33 private:
34 bool observed_; 34 bool observed_;
35 scoped_refptr<content::MessageLoopRunner> runner_; 35 scoped_refptr<content::MessageLoopRunner> runner_;
36 36
37 DISALLOW_COPY_AND_ASSIGN(Waiter); 37 DISALLOW_COPY_AND_ASSIGN(Waiter);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 void TestExtensionRegistryObserver::OnExtensionUnloaded( 96 void TestExtensionRegistryObserver::OnExtensionUnloaded(
97 content::BrowserContext* browser_context, 97 content::BrowserContext* browser_context,
98 const Extension* extension, 98 const Extension* extension,
99 UnloadedExtensionInfo::Reason reason) { 99 UnloadedExtensionInfo::Reason reason) {
100 if (extension->id() == extension_id_) 100 if (extension->id() == extension_id_)
101 unloaded_waiter_->OnObserved(); 101 unloaded_waiter_->OnObserved();
102 } 102 }
103 103
104 } // namespace extensions 104 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/runtime_data_unittest.cc ('k') | extensions/common/extension_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698