| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <time.h> | 5 #include <time.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 private: | 138 private: |
| 139 bool result_; | 139 bool result_; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 class GetCookieStringCallback : public CookieCallback { | 142 class GetCookieStringCallback : public CookieCallback { |
| 143 public: | 143 public: |
| 144 GetCookieStringCallback() {} | 144 GetCookieStringCallback() {} |
| 145 explicit GetCookieStringCallback(Thread* run_in_thread) | 145 explicit GetCookieStringCallback(Thread* run_in_thread) |
| 146 : CookieCallback(run_in_thread) {} | 146 : CookieCallback(run_in_thread) {} |
| 147 | 147 |
| 148 void Run(std::string cookie) { | 148 void Run(const std::string& cookie) { |
| 149 cookie_ = cookie; | 149 cookie_ = cookie; |
| 150 CallbackEpilogue(); | 150 CallbackEpilogue(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 const std::string& cookie() { return cookie_; } | 153 const std::string& cookie() { return cookie_; } |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 std::string cookie_; | 156 std::string cookie_; |
| 157 }; | 157 }; |
| 158 | 158 |
| (...skipping 3452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3611 // Delete the cookie. | 3611 // Delete the cookie. |
| 3612 DeleteCookie(cm, url_google_, "A"); | 3612 DeleteCookie(cm, url_google_, "A"); |
| 3613 EXPECT_EQ("", GetCookies(cm, url_google_)); | 3613 EXPECT_EQ("", GetCookies(cm, url_google_)); |
| 3614 EXPECT_EQ(4u, store->commands().size()); | 3614 EXPECT_EQ(4u, store->commands().size()); |
| 3615 EXPECT_EQ(CookieStoreCommand::REMOVE, store->commands()[3].type); | 3615 EXPECT_EQ(CookieStoreCommand::REMOVE, store->commands()[3].type); |
| 3616 EXPECT_EQ("A", store->commands()[3].cookie.Name()); | 3616 EXPECT_EQ("A", store->commands()[3].cookie.Name()); |
| 3617 EXPECT_EQ("C", store->commands()[3].cookie.Value()); | 3617 EXPECT_EQ("C", store->commands()[3].cookie.Value()); |
| 3618 } | 3618 } |
| 3619 | 3619 |
| 3620 } // namespace net | 3620 } // namespace net |
| OLD | NEW |