| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/perftimer.h" | 9 #include "base/perftimer.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "googleurl/src/gurl.h" | |
| 13 #include "net/cookies/canonical_cookie.h" | 12 #include "net/cookies/canonical_cookie.h" |
| 14 #include "net/cookies/cookie_monster.h" | 13 #include "net/cookies/cookie_monster.h" |
| 15 #include "net/cookies/cookie_monster_store_test.h" | 14 #include "net/cookies/cookie_monster_store_test.h" |
| 16 #include "net/cookies/parsed_cookie.h" | 15 #include "net/cookies/parsed_cookie.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const int kNumCookies = 20000; | 23 const int kNumCookies = 20000; |
| 24 const char kCookieLine[] = "A = \"b=;\\\"\" ;secure;;;"; | 24 const char kCookieLine[] = "A = \"b=;\\\"\" ;secure;;;"; |
| 25 const char kGoogleURL[] = "http://www.google.izzle"; | 25 const char kGoogleURL[] = "http://www.google.izzle"; |
| 26 | 26 |
| 27 int CountInString(const std::string& str, char c) { | 27 int CountInString(const std::string& str, char c) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 setCookieCallback.SetCookie(cm.get(), gurl, cookie_line); | 376 setCookieCallback.SetCookie(cm.get(), gurl, cookie_line); |
| 377 | 377 |
| 378 PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str()); | 378 PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str()); |
| 379 for (int i = 0; i < kNumCookies; i++) | 379 for (int i = 0; i < kNumCookies; i++) |
| 380 setCookieCallback.SetCookie(cm.get(), gurl, cookie_line); | 380 setCookieCallback.SetCookie(cm.get(), gurl, cookie_line); |
| 381 timer.Done(); | 381 timer.Done(); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace net | 385 } // namespace net |
| OLD | NEW |