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

Unified Diff: components/nacl/browser/pnacl_host_unittest.cc

Issue 2207683002: Use a raw pointer instead of Singleton for PnaclHost and leak it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b6_sequenced_worker_pool_redirection
Patch Set: typo Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/browser/pnacl_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/pnacl_host_unittest.cc
diff --git a/components/nacl/browser/pnacl_host_unittest.cc b/components/nacl/browser/pnacl_host_unittest.cc
index 39bd6d4257de52912e0e61107915a3e82fbf8f61..37cdadbd85887d7323b5f5a4e600ad563d6a3a3a 100644
--- a/components/nacl/browser/pnacl_host_unittest.cc
+++ b/components/nacl/browser/pnacl_host_unittest.cc
@@ -41,7 +41,7 @@ class PnaclHostTest : public testing::Test {
write_callback_count_(0),
thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {}
void SetUp() override {
- host_ = new PnaclHost();
+ host_ = PnaclHost::GetInstance();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
host_->InitForTest(temp_dir_.path(), true);
base::RunLoop().RunUntilIdle();
@@ -53,7 +53,6 @@ class PnaclHostTest : public testing::Test {
host_->RendererClosing(0);
content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(PnaclHost::CacheUninitialized, host_->cache_state_);
- delete host_;
}
int GetCacheSize() { return host_->disk_cache_->Size(); }
int CacheIsInitialized() {
@@ -441,7 +440,7 @@ TEST_F(PnaclHostTest, ClearTranslationCache) {
class PnaclHostTestDisk : public PnaclHostTest {
protected:
void SetUp() override {
- host_ = new PnaclHost();
+ host_ = PnaclHost::GetInstance();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
host_->InitForTest(temp_dir_.path(), false);
EXPECT_EQ(PnaclHost::CacheInitializing, host_->cache_state_);
« no previous file with comments | « components/nacl/browser/pnacl_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698