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

Unified Diff: net/cookies/cookie_monster_perftest.cc

Issue 1701063002: CookieStore: Remove reference counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe
Patch Set: merge Created 4 years, 9 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 | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_monster_store_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster_perftest.cc
diff --git a/net/cookies/cookie_monster_perftest.cc b/net/cookies/cookie_monster_perftest.cc
index dd35638ead3a2217f5f9c3a8b243554eb54453e8..82ef9dd85b574701c5b2eb174cf2aafb5722e1de 100644
--- a/net/cookies/cookie_monster_perftest.cc
+++ b/net/cookies/cookie_monster_perftest.cc
@@ -5,6 +5,8 @@
#include <algorithm>
#include "base/bind.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -119,7 +121,7 @@ TEST(ParsedCookieTest, TestParseBigCookies) {
}
TEST_F(CookieMonsterTest, TestAddCookiesOnSingleHost) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
+ scoped_ptr<CookieMonster> cm(new CookieMonster(nullptr, nullptr));
std::vector<std::string> cookies;
for (int i = 0; i < kNumCookies; i++) {
cookies.push_back(base::StringPrintf("a%03d=b", i));
@@ -152,7 +154,7 @@ TEST_F(CookieMonsterTest, TestAddCookiesOnSingleHost) {
}
TEST_F(CookieMonsterTest, TestAddCookieOnManyHosts) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
+ scoped_ptr<CookieMonster> cm(new CookieMonster(nullptr, nullptr));
std::string cookie(kCookieLine);
std::vector<GURL> gurls; // just wanna have ffffuunnn
for (int i = 0; i < kNumCookies; ++i) {
@@ -185,7 +187,7 @@ TEST_F(CookieMonsterTest, TestAddCookieOnManyHosts) {
}
TEST_F(CookieMonsterTest, TestDomainTree) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
+ scoped_ptr<CookieMonster> cm(new CookieMonster(nullptr, nullptr));
GetCookiesCallback getCookiesCallback;
SetCookieCallback setCookieCallback;
const char domain_cookie_format_tree[] = "a=b; domain=%s";
@@ -238,7 +240,7 @@ TEST_F(CookieMonsterTest, TestDomainTree) {
}
TEST_F(CookieMonsterTest, TestDomainLine) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
+ scoped_ptr<CookieMonster> cm(new CookieMonster(nullptr, nullptr));
SetCookieCallback setCookieCallback;
GetCookiesCallback getCookiesCallback;
std::vector<std::string> domain_list;
@@ -300,7 +302,7 @@ TEST_F(CookieMonsterTest, TestImport) {
store->SetLoadExpectation(true, initial_cookies);
- scoped_refptr<CookieMonster> cm(new CookieMonster(store.get(), NULL));
+ scoped_ptr<CookieMonster> cm(new CookieMonster(store.get(), nullptr));
// Import will happen on first access.
GURL gurl("www.google.com");
@@ -314,7 +316,7 @@ TEST_F(CookieMonsterTest, TestImport) {
}
TEST_F(CookieMonsterTest, TestGetKey) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
+ scoped_ptr<CookieMonster> cm(new CookieMonster(nullptr, nullptr));
base::PerfTimeLogger timer("Cookie_monster_get_key");
for (int i = 0; i < kNumCookies; i++)
cm->GetKey("www.google.com");
@@ -370,9 +372,9 @@ TEST_F(CookieMonsterTest, TestGCTimes) {
};
for (int ci = 0; ci < static_cast<int>(arraysize(test_cases)); ++ci) {
const TestCase& test_case(test_cases[ci]);
- scoped_refptr<CookieMonster> cm(CreateMonsterFromStoreForGC(
+ scoped_ptr<CookieMonster> cm = CreateMonsterFromStoreForGC(
test_case.num_cookies, test_case.num_old_cookies, 0, 0,
- CookieMonster::kSafeFromGlobalPurgeDays * 2));
+ CookieMonster::kSafeFromGlobalPurgeDays * 2);
GURL gurl("http://google.com");
std::string cookie_line("z=3");
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_monster_store_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698