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

Unified Diff: chrome/browser/component_updater/sth_set_component_installer_unittest.cc

Issue 2014573002: Certificate Transparency: Wire the TreeStateTracker up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing DCHECKs Created 4 years, 7 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/component_updater/sth_set_component_installer_unittest.cc
diff --git a/chrome/browser/component_updater/sth_set_component_installer_unittest.cc b/chrome/browser/component_updater/sth_set_component_installer_unittest.cc
index 5b6b1014df17374c4b0da5d2798a54aa5b501ef5..c68877bfbc5aa82815c432cf0917a73d7d6abb36 100644
--- a/chrome/browser/component_updater/sth_set_component_installer_unittest.cc
+++ b/chrome/browser/component_updater/sth_set_component_installer_unittest.cc
@@ -44,9 +44,8 @@ class STHSetComponentInstallerTest : public PlatformTest {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- std::unique_ptr<StoringSTHObserver> observer(new StoringSTHObserver());
- observer_ = observer.get();
- traits_.reset(new STHSetComponentInstallerTraits(std::move(observer)));
+ observer_.reset(new StoringSTHObserver());
+ traits_.reset(new STHSetComponentInstallerTraits(observer_.get()));
}
void WriteSTHToFile(const std::string& sth_json,
@@ -82,8 +81,10 @@ class STHSetComponentInstallerTest : public PlatformTest {
content::TestBrowserThreadBundle thread_bundle_;
base::ScopedTempDir temp_dir_;
+ std::unique_ptr<StoringSTHObserver> observer_;
+ // traits_ should be destroyed before the observer_ as it holds a pointer
Lei Zhang 2016/05/27 18:24:32 nits: Refer to variables as |foo|, is that a doubl
Eran Messeri 2016/05/31 11:30:56 Done.
+ // to it.
std::unique_ptr<STHSetComponentInstallerTraits> traits_;
- StoringSTHObserver* observer_;
safe_json::TestingJsonParser::ScopedFactoryOverride factory_override_;
private:

Powered by Google App Engine
This is Rietveld 408576698