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

Unified Diff: net/base/cookie_monster_store_test.h

Issue 7860039: Re-land http://codereview.chromium.org/7831056/ and http://codereview.chromium.org/7833042/ . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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/base/cookie_monster_perftest.cc ('k') | net/base/cookie_monster_store_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_monster_store_test.h
===================================================================
--- net/base/cookie_monster_store_test.h (revision 100345)
+++ net/base/cookie_monster_store_test.h (working copy)
@@ -7,6 +7,14 @@
// that need to test out CookieMonster interactions with the backing store.
// It should only be included by test code.
+#ifndef NET_BASE_COOKIE_MONSTER_STORE_TEST_H_
+#define NET_BASE_COOKIE_MONSTER_STORE_TEST_H_
+#pragma once
+
+#include <map>
+#include <utility>
+#include <string>
+#include <vector>
#include "net/base/cookie_monster.h"
namespace base {
@@ -51,21 +59,20 @@
return commands_;
}
- virtual bool Load(
- std::vector<CookieMonster::CanonicalCookie*>* out_cookies);
+ virtual bool Load(const LoadedCallback& loaded_callback) OVERRIDE;
- virtual void AddCookie(const CookieMonster::CanonicalCookie& cookie);
+ virtual void AddCookie(const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void UpdateCookieAccessTime(
- const CookieMonster::CanonicalCookie& cookie);
+ const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void DeleteCookie(
- const CookieMonster::CanonicalCookie& cookie);
+ const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
- virtual void Flush(Task* completion_task);
+ virtual void Flush(Task* completion_task) OVERRIDE;
// No files are created so nothing to clear either
- virtual void SetClearLocalStateOnExit(bool clear_local_state);
+ virtual void SetClearLocalStateOnExit(bool clear_local_state) OVERRIDE;
private:
CommandList commands_;
@@ -102,6 +109,12 @@
DISALLOW_COPY_AND_ASSIGN(MockCookieMonsterDelegate);
};
+// Helper to build a single CanonicalCookie.
+CookieMonster::CanonicalCookie BuildCanonicalCookie(
+ const std::string& key,
+ const std::string& cookie_line,
+ const base::Time& creation_time);
+
// Helper to build a list of CanonicalCookie*s.
void AddCookieToList(
const std::string& key,
@@ -117,8 +130,7 @@
MockSimplePersistentCookieStore();
virtual ~MockSimplePersistentCookieStore();
- virtual bool Load(
- std::vector<CookieMonster::CanonicalCookie*>* out_cookies);
+ virtual bool Load(const LoadedCallback& loaded_callback);
virtual void AddCookie(
const CookieMonster::CanonicalCookie& cookie);
@@ -154,3 +166,5 @@
int days_old);
} // namespace net
+
+#endif // NET_BASE_COOKIE_MONSTER_STORE_TEST_H_
« no previous file with comments | « net/base/cookie_monster_perftest.cc ('k') | net/base/cookie_monster_store_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698