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

Side by Side Diff: net/base/cookie_monster_perftest.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/video_renderer_base_unittest.cc ('k') | net/base/cookie_monster_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "net/base/cookie_monster.h" 5 #include "net/base/cookie_monster.h"
6 6
7 #include "base/perftimer.h" 7 #include "base/perftimer.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 CookieMonster::kMaxCookies * 3 / 4, 276 CookieMonster::kMaxCookies * 3 / 4,
277 }, { 277 }, {
278 "less_than_gc_thresh", 278 "less_than_gc_thresh",
279 // Few enough cookies that gc shouldn't happen at all. 279 // Few enough cookies that gc shouldn't happen at all.
280 CookieMonster::kMaxCookies - 5, 280 CookieMonster::kMaxCookies - 5,
281 0, 281 0,
282 }, 282 },
283 }; 283 };
284 for (int ci = 0; ci < static_cast<int>(ARRAYSIZE_UNSAFE(test_cases)); ++ci) { 284 for (int ci = 0; ci < static_cast<int>(ARRAYSIZE_UNSAFE(test_cases)); ++ci) {
285 const TestCase& test_case(test_cases[ci]); 285 const TestCase& test_case(test_cases[ci]);
286 scoped_refptr<CookieMonster> cm = 286 scoped_refptr<CookieMonster> cm(
287 CreateMonsterFromStoreForGC( 287 CreateMonsterFromStoreForGC(
288 test_case.num_cookies, test_case.num_old_cookies, 288 test_case.num_cookies, test_case.num_old_cookies,
289 CookieMonster::kSafeFromGlobalPurgeDays * 2); 289 CookieMonster::kSafeFromGlobalPurgeDays * 2));
290 290
291 GURL gurl("http://google.com"); 291 GURL gurl("http://google.com");
292 std::string cookie_line("z=3"); 292 std::string cookie_line("z=3");
293 // Trigger the Garbage collection we're allowed. 293 // Trigger the Garbage collection we're allowed.
294 EXPECT_TRUE(cm->SetCookie(gurl, cookie_line)); 294 EXPECT_TRUE(cm->SetCookie(gurl, cookie_line));
295 295
296 PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str()); 296 PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str());
297 for (int i = 0; i < kNumCookies; i++) 297 for (int i = 0; i < kNumCookies; i++)
298 EXPECT_TRUE(cm->SetCookie(gurl, cookie_line)); 298 EXPECT_TRUE(cm->SetCookie(gurl, cookie_line));
299 timer.Done(); 299 timer.Done();
300 } 300 }
301 } 301 }
302 302
303 } // namespace 303 } // namespace
OLDNEW
« no previous file with comments | « media/filters/video_renderer_base_unittest.cc ('k') | net/base/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698