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

Unified Diff: net/base/cookie_monster_perftest.cc

Issue 368001: Second patch in making destructors of refcounted objects private. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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: net/base/cookie_monster_perftest.cc
===================================================================
--- net/base/cookie_monster_perftest.cc (revision 31079)
+++ net/base/cookie_monster_perftest.cc (working copy)
@@ -40,7 +40,7 @@
static const GURL kUrlGoogle("http://www.google.izzle");
TEST(CookieMonsterTest, TestAddCookiesOnSingleHost) {
- net::CookieMonster cm;
+ scoped_refptr<net::CookieMonster> cm(new net::CookieMonster);
std::vector<std::string> cookies;
for (int i = 0; i < kNumCookies; i++) {
cookies.push_back(StringPrintf("a%03d=b", i));
@@ -50,24 +50,24 @@
PerfTimeLogger timer("Cookie_monster_add_single_host");
for (std::vector<std::string>::const_iterator it = cookies.begin();
it != cookies.end(); ++it) {
- EXPECT_TRUE(cm.SetCookie(kUrlGoogle, *it));
+ EXPECT_TRUE(cm->SetCookie(kUrlGoogle, *it));
}
timer.Done();
PerfTimeLogger timer2("Cookie_monster_query_single_host");
for (std::vector<std::string>::const_iterator it = cookies.begin();
it != cookies.end(); ++it) {
- cm.GetCookies(kUrlGoogle);
+ cm->GetCookies(kUrlGoogle);
}
timer2.Done();
PerfTimeLogger timer3("Cookie_monster_deleteall_single_host");
- cm.DeleteAll(false);
+ cm->DeleteAll(false);
timer3.Done();
}
TEST(CookieMonsterTest, TestAddCookieOnManyHosts) {
- net::CookieMonster cm;
+ scoped_refptr<net::CookieMonster> cm(new net::CookieMonster);
std::string cookie(kCookieLine);
std::vector<GURL> gurls; // just wanna have ffffuunnn
for (int i = 0; i < kNumCookies; ++i) {
@@ -78,18 +78,18 @@
PerfTimeLogger timer("Cookie_monster_add_many_hosts");
for (std::vector<GURL>::const_iterator it = gurls.begin();
it != gurls.end(); ++it) {
- EXPECT_TRUE(cm.SetCookie(*it, cookie));
+ EXPECT_TRUE(cm->SetCookie(*it, cookie));
}
timer.Done();
PerfTimeLogger timer2("Cookie_monster_query_many_hosts");
for (std::vector<GURL>::const_iterator it = gurls.begin();
it != gurls.end(); ++it) {
- cm.GetCookies(*it);
+ cm->GetCookies(*it);
}
timer2.Done();
PerfTimeLogger timer3("Cookie_monster_deleteall_many_hosts");
- cm.DeleteAll(false);
+ cm->DeleteAll(false);
timer3.Done();
}

Powered by Google App Engine
This is Rietveld 408576698