Move the cookie store implementation into its own directory.

In the initial step, forwarding headers are left in net/base/cookie_*h . After all clients are updated these will be removed and erikwright will be removed from net/base/OWNERS

BUG=70818
TEST=compilation


Review URL: http://codereview.chromium.org/9703011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126871 0039d316-1c4b-4281-b951-d872f2087c98
parent ca2fd075
This diff is collapsed.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// This file contains test infrastructure for multiple files // Provides a temporary redirection while clients are updated to use the new
// (current cookie_monster_unittest.cc and cookie_monster_perftest.cc) // path.
// 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_ #ifndef NET_BASE_COOKIE_MONSTER_STORE_TEST_H_
#define NET_BASE_COOKIE_MONSTER_STORE_TEST_H_ #define NET_BASE_COOKIE_MONSTER_STORE_TEST_H_
#pragma once #pragma once
#include <map> #include "net/cookies/cookie_monster_store_test.h"
#include <string>
#include <utility>
#include <vector>
#include "net/base/cookie_monster.h"
namespace base {
class Time;
}
namespace net {
// Wrapper class for posting a loaded callback. Since the Callback class is not
// reference counted, we cannot post a callback to the message loop directly,
// instead we post a LoadedCallbackTask.
class LoadedCallbackTask
: public base::RefCountedThreadSafe<LoadedCallbackTask> {
public:
typedef CookieMonster::PersistentCookieStore::LoadedCallback LoadedCallback;
LoadedCallbackTask(LoadedCallback loaded_callback,
std::vector<CookieMonster::CanonicalCookie*> cookies);
~LoadedCallbackTask();
void Run() {
loaded_callback_.Run(cookies_);
}
private:
LoadedCallback loaded_callback_;
std::vector<CookieMonster::CanonicalCookie*> cookies_;
DISALLOW_COPY_AND_ASSIGN(LoadedCallbackTask);
}; // Wrapper class LoadedCallbackTask
// Describes a call to one of the 3 functions of PersistentCookieStore.
struct CookieStoreCommand {
enum Type {
ADD,
UPDATE_ACCESS_TIME,
REMOVE,
};
CookieStoreCommand(Type type,
const CookieMonster::CanonicalCookie& cookie)
: type(type),
cookie(cookie) {}
Type type;
CookieMonster::CanonicalCookie cookie;
};
// Implementation of PersistentCookieStore that captures the
// received commands and saves them to a list.
// The result of calls to Load() can be configured using SetLoadExpectation().
class MockPersistentCookieStore
: public CookieMonster::PersistentCookieStore {
public:
typedef std::vector<CookieStoreCommand> CommandList;
MockPersistentCookieStore();
virtual ~MockPersistentCookieStore();
void SetLoadExpectation(
bool return_value,
const std::vector<CookieMonster::CanonicalCookie*>& result);
const CommandList& commands() const {
return commands_;
}
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
virtual void LoadCookiesForKey(const std::string& key,
const LoadedCallback& loaded_callback) OVERRIDE;
virtual void AddCookie(const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void UpdateCookieAccessTime(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void DeleteCookie(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
// No files are created so nothing to clear either
virtual void SetClearLocalStateOnExit(bool clear_local_state) OVERRIDE;
private:
CommandList commands_;
// Deferred result to use when Load() is called.
bool load_return_value_;
std::vector<CookieMonster::CanonicalCookie*> load_result_;
// Indicates if the store has been fully loaded to avoid returning duplicate
// cookies.
bool loaded_;
DISALLOW_COPY_AND_ASSIGN(MockPersistentCookieStore);
};
// Mock for CookieMonster::Delegate
class MockCookieMonsterDelegate : public CookieMonster::Delegate {
public:
typedef std::pair<CookieMonster::CanonicalCookie, bool>
CookieNotification;
MockCookieMonsterDelegate();
const std::vector<CookieNotification>& changes() const { return changes_; }
void reset() { changes_.clear(); }
virtual void OnCookieChanged(
const CookieMonster::CanonicalCookie& cookie,
bool removed,
CookieMonster::Delegate::ChangeCause cause) OVERRIDE;
private:
virtual ~MockCookieMonsterDelegate();
std::vector<CookieNotification> changes_;
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,
const std::string& cookie_line,
const base::Time& creation_time,
std::vector<CookieMonster::CanonicalCookie*>* out_list);
// Just act like a backing database. Keep cookie information from
// Add/Update/Delete and regurgitate it when Load is called.
class MockSimplePersistentCookieStore
: public CookieMonster::PersistentCookieStore {
public:
MockSimplePersistentCookieStore();
virtual ~MockSimplePersistentCookieStore();
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
virtual void LoadCookiesForKey(const std::string& key,
const LoadedCallback& loaded_callback) OVERRIDE;
virtual void AddCookie(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void UpdateCookieAccessTime(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void DeleteCookie(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
virtual void SetClearLocalStateOnExit(bool clear_local_state) OVERRIDE;
private:
typedef std::map<int64, CookieMonster::CanonicalCookie>
CanonicalCookieMap;
CanonicalCookieMap cookies_;
// Indicates if the store has been fully loaded to avoid return duplicate
// cookies in subsequent load requests
bool loaded_;
};
// Helper function for creating a CookieMonster backed by a
// MockSimplePersistentCookieStore for garbage collection testing.
//
// Fill the store through import with |num_cookies| cookies, |num_old_cookies|
// with access time Now()-days_old, the rest with access time Now().
// Do two SetCookies(). Return whether each of the two SetCookies() took
// longer than |gc_perf_micros| to complete, and how many cookie were
// left in the store afterwards.
CookieMonster* CreateMonsterFromStoreForGC(
int num_cookies,
int num_old_cookies,
int days_old);
} // namespace net
#endif // NET_BASE_COOKIE_MONSTER_STORE_TEST_H_ #endif // NET_BASE_COOKIE_MONSTER_STORE_TEST_H_
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Brought to you by number 42. // Provides a temporary redirection while clients are updated to use the new
// path.
#ifndef NET_BASE_COOKIE_OPTIONS_H_ #ifndef NET_BASE_COOKIE_OPTIONS_H_
#define NET_BASE_COOKIE_OPTIONS_H_ #define NET_BASE_COOKIE_OPTIONS_H_
#pragma once #pragma once
namespace net { #include "net/cookies/cookie_options.h"
class CookieOptions {
public:
// Default is to exclude httponly, which means:
// - reading operations will not return httponly cookies.
// - writing operations will not write httponly cookies.
CookieOptions()
: exclude_httponly_(true),
force_session_(false) {
}
void set_exclude_httponly() { exclude_httponly_ = true; }
void set_include_httponly() { exclude_httponly_ = false; }
bool exclude_httponly() const { return exclude_httponly_; }
// Forces a cookie to be saved as a session cookie. If the expiration time of
// the cookie is in the past, i.e. the cookie would end up being deleted, this
// option is ignored. See CookieMonsterTest.ForceSessionOnly.
void set_force_session() { force_session_ = true; }
bool force_session() const { return force_session_; }
private:
bool exclude_httponly_;
bool force_session_;
};
} // namespace net
#endif // NET_BASE_COOKIE_OPTIONS_H_ #endif // NET_BASE_COOKIE_OPTIONS_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Brought to you by number 42. // Provides a temporary redirection while clients are updated to use the new
// path.
#ifndef NET_BASE_COOKIE_STORE_H_ #ifndef NET_BASE_COOKIE_STORE_H_
#define NET_BASE_COOKIE_STORE_H_ #define NET_BASE_COOKIE_STORE_H_
#pragma once #pragma once
#include <string> #include "net/cookies/cookie_store.h"
#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
#include "net/base/cookie_options.h"
#include "net/base/net_export.h"
class GURL;
namespace net {
class CookieMonster;
// An interface for storing and retrieving cookies. Implementations need to
// be thread safe as its methods can be accessed from IO as well as UI threads.
class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
public:
// This struct contains additional consumer-specific information that might
// be stored with cookies; currently just MAC information, see:
// http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac
struct NET_EXPORT CookieInfo {
CookieInfo();
~CookieInfo();
// The name of the cookie.
std::string name;
// TODO(abarth): Add value if any clients need it.
// The time at which the cookie was created.
base::Time creation_date;
// The value of the MAC-Key and MAC-Algorithm attributes, if present.
std::string mac_key;
std::string mac_algorithm;
};
// Callback definitions.
typedef base::Callback <void(
const std::string& cookie_line,
const std::vector<CookieInfo>& cookie_infos)> GetCookieInfoCallback;
typedef base::Callback<void(const std::string& cookie)>
GetCookiesCallback;
typedef base::Callback<void(bool success)> SetCookiesCallback;
typedef base::Callback<void(int num_deleted)> DeleteCallback;
// Sets a single cookie. Expects a cookie line, like "a=1; domain=b.com".
//
// Fails either if the cookie is invalid or if this is a non-HTTPONLY cookie
// and it would overwrite an existing HTTPONLY cookie.
// Returns true if the cookie is successfully set.
virtual void SetCookieWithOptionsAsync(
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
const SetCookiesCallback& callback) = 0;
// TODO(???): what if the total size of all the cookies >4k, can we have a
// header that big or do we need multiple Cookie: headers?
// Note: Some sites, such as Facebook, occasionally use Cookie headers >4k.
//
// Simple interface, gets a cookie string "a=b; c=d" for the given URL.
// Use options to access httponly cookies.
virtual void GetCookiesWithOptionsAsync(
const GURL& url, const CookieOptions& options,
const GetCookiesCallback& callback) = 0;
// This function is similar to GetCookiesWithOptions same functionality as
// GetCookiesWithOptions except that it additionally provides detailed
// information about the cookie contained in the cookie line. See |struct
// CookieInfo| above for details.
virtual void GetCookiesWithInfoAsync(
const GURL& url,
const CookieOptions& options,
const GetCookieInfoCallback& callback) = 0;
// Deletes the passed in cookie for the specified URL.
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) = 0;
// Deletes all of the cookies that have a creation_date greater than or equal
// to |delete_begin| and less than |delete_end|
// Returns the number of cookies that have been deleted.
virtual void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
const base::Time& delete_end,
const DeleteCallback& callback) = 0;
// Returns the underlying CookieMonster.
virtual CookieMonster* GetCookieMonster() = 0;
protected:
friend class base::RefCountedThreadSafe<CookieStore>;
CookieStore();
virtual ~CookieStore();
};
} // namespace net
#endif // NET_BASE_COOKIE_STORE_H_ #endif // NET_BASE_COOKIE_STORE_H_
...@@ -2,136 +2,13 @@ ...@@ -2,136 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Provides a temporary redirection while clients are updated to use the new
// path.
#ifndef NET_BASE_COOKIE_STORE_TEST_CALLBACKS_H_ #ifndef NET_BASE_COOKIE_STORE_TEST_CALLBACKS_H_
#define NET_BASE_COOKIE_STORE_TEST_CALLBACKS_H_ #define NET_BASE_COOKIE_STORE_TEST_CALLBACKS_H_
#pragma once #pragma once
#include <string> #include "net/cookies/cookie_store_test_callbacks.h"
#include <vector>
#include "net/base/cookie_store.h"
class MessageLoop;
namespace base {
class Thread;
}
namespace net {
// Defines common behaviour for the callbacks from GetCookies, SetCookies, etc.
// Asserts that the current thread is the expected invocation thread, sends a
// quit to the thread in which it was constructed.
class CookieCallback {
public:
// Indicates whether the callback has been called.
bool did_run() { return did_run_; }
protected:
// Constructs a callback that expects to be called in the given thread and
// will, upon execution, send a QUIT to the constructing thread.
explicit CookieCallback(base::Thread* run_in_thread);
// Constructs a callback that expects to be called in current thread and will
// send a QUIT to the constructing thread.
CookieCallback();
// Tests whether the current thread was the caller's thread.
// Sends a QUIT to the constructing thread.
void CallbackEpilogue();
private:
bool did_run_;
base::Thread* run_in_thread_;
MessageLoop* run_in_loop_;
MessageLoop* parent_loop_;
MessageLoop* loop_to_quit_;
};
// Callback implementations for the asynchronous CookieStore methods.
class SetCookieCallback : public CookieCallback {
public:
SetCookieCallback();
explicit SetCookieCallback(base::Thread* run_in_thread);
void Run(bool result) {
result_ = result;
CallbackEpilogue();
}
bool result() { return result_; }
private:
bool result_;
};
class GetCookieStringCallback : public CookieCallback {
public:
GetCookieStringCallback();
explicit GetCookieStringCallback(base::Thread* run_in_thread);
void Run(const std::string& cookie) {
cookie_ = cookie;
CallbackEpilogue();
}
const std::string& cookie() { return cookie_; }
private:
std::string cookie_;
};
class GetCookiesWithInfoCallback : public CookieCallback {
public:
GetCookiesWithInfoCallback();
explicit GetCookiesWithInfoCallback(base::Thread* run_in_thread);
~GetCookiesWithInfoCallback();
void Run(
const std::string& cookie_line,
const std::vector<CookieStore::CookieInfo>& cookie_info) {
cookie_line_ = cookie_line;
cookie_info_ = cookie_info;
CallbackEpilogue();
}
const std::string& cookie_line() { return cookie_line_; }
const std::vector<CookieStore::CookieInfo>& cookie_info() {
return cookie_info_;
}
private:
std::string cookie_line_;
std::vector<CookieStore::CookieInfo> cookie_info_;
};
class DeleteCallback : public CookieCallback {
public:
DeleteCallback();
explicit DeleteCallback(base::Thread* run_in_thread);
void Run(int num_deleted) {
num_deleted_ = num_deleted;
CallbackEpilogue();
}
int num_deleted() { return num_deleted_; }
private:
int num_deleted_;
};
class DeleteCookieCallback : public CookieCallback {
public:
DeleteCookieCallback();
explicit DeleteCookieCallback(base::Thread* run_in_thread);
void Run() {
CallbackEpilogue();
}
};
} // namespace net
#endif // NET_BASE_COOKIE_STORE_TEST_CALLBACKS_H_ #endif // NET_BASE_COOKIE_STORE_TEST_CALLBACKS_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Provides a temporary redirection while clients are updated to use the new
// path.
#ifndef NET_BASE_COOKIE_STORE_TEST_HELPERS_H_ #ifndef NET_BASE_COOKIE_STORE_TEST_HELPERS_H_
#define NET_BASE_COOKIE_STORE_TEST_HELPERS_H_ #define NET_BASE_COOKIE_STORE_TEST_HELPERS_H_
#pragma once #pragma once
#include "net/base/cookie_monster.h" #include "net/cookies/cookie_store_test_helpers.h"
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
class DelayedCookieMonster : public CookieStore {
public:
DelayedCookieMonster();
// Call the asynchronous CookieMonster function, expect it to immediately
// invoke the internal callback.
// Post a delayed task to invoke the original callback with the results.
virtual void SetCookieWithOptionsAsync(
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
const CookieMonster::SetCookiesCallback& callback) OVERRIDE;
virtual void GetCookiesWithOptionsAsync(
const GURL& url, const CookieOptions& options,
const CookieMonster::GetCookiesCallback& callback) OVERRIDE;
virtual void GetCookiesWithInfoAsync(
const GURL& url,
const CookieOptions& options,
const CookieMonster::GetCookieInfoCallback& callback) OVERRIDE;
virtual bool SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
const CookieOptions& options);
virtual std::string GetCookiesWithOptions(const GURL& url,
const CookieOptions& options);
virtual void GetCookiesWithInfo(const GURL& url,
const CookieOptions& options,
std::string* cookie_line,
std::vector<CookieInfo>* cookie_infos);
virtual void DeleteCookie(const GURL& url,
const std::string& cookie_name);
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) OVERRIDE;
virtual void DeleteAllCreatedBetweenAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
const DeleteCallback& callback) OVERRIDE;
virtual CookieMonster* GetCookieMonster() OVERRIDE;
private:
// Be called immediately from CookieMonster.
void GetCookiesInternalCallback(
const std::string& cookie_line,
const std::vector<CookieStore::CookieInfo>& cookie_info);
void SetCookiesInternalCallback(bool result);
void GetCookiesWithOptionsInternalCallback(const std::string& cookie);
// Invoke the original callbacks.
void InvokeGetCookiesCallback(
const CookieMonster::GetCookieInfoCallback& callback);
void InvokeSetCookiesCallback(
const CookieMonster::SetCookiesCallback& callback);
void InvokeGetCookieStringCallback(
const CookieMonster::GetCookiesCallback& callback);
friend class base::RefCountedThreadSafe<DelayedCookieMonster>;
virtual ~DelayedCookieMonster();
scoped_refptr<CookieMonster> cookie_monster_;
bool did_run_;
bool result_;
std::string cookie_;
std::string cookie_line_;
std::vector<CookieStore::CookieInfo> cookie_info_;
};
} // namespace net
#endif // NET_BASE_COOKIE_STORE_TEST_HELPERS_H_ #endif // NET_BASE_COOKIE_STORE_TEST_HELPERS_H_
This diff is collapsed.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Provides a temporary redirection while clients are updated to use the new
// path.
#ifndef NET_BASE_COOKIE_UTIL_H_ #ifndef NET_BASE_COOKIE_UTIL_H_
#define NET_BASE_COOKIE_UTIL_H_ #define NET_BASE_COOKIE_UTIL_H_
#pragma once #pragma once
#include <string> #include "net/cookies/cookie_util.h"
#include "net/base/net_export.h"
class GURL;
namespace net {
namespace cookie_util {
// Returns the effective TLD+1 for a given host. This only makes sense for http
// and https schemes. For other schemes, the host will be returned unchanged
// (minus any leading period).
NET_EXPORT std::string GetEffectiveDomain(const std::string& scheme,
const std::string& host);
// Determine the actual cookie domain based on the domain string passed
// (if any) and the URL from which the cookie came.
// On success returns true, and sets cookie_domain to either a
// -host cookie domain (ex: "google.com")
// -domain cookie domain (ex: ".google.com")
NET_EXPORT bool GetCookieDomainWithString(const GURL& url,
const std::string& domain_string,
std::string* result);
// Returns true if a domain string represents a host-only cookie,
// i.e. it doesn't begin with a leading '.' character.
NET_EXPORT bool DomainIsHostOnly(const std::string& domain_string);
} // namspace cookie_util
} // namespace net
#endif // NET_BASE_COOKIE_UTIL_H_ #endif // NET_BASE_COOKIE_UTIL_H_
erikwright@chromium.org
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#include "net/base/cookie_monster.h" #include "net/cookies/cookie_monster.h"
#include <algorithm> #include <algorithm>
#include <set> #include <set>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#include "base/stringprintf.h" #include "base/stringprintf.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "googleurl/src/url_canon.h" #include "googleurl/src/url_canon.h"
#include "net/base/cookie_util.h" #include "net/cookies/cookie_util.h"
#include "net/base/registry_controlled_domain.h" #include "net/base/registry_controlled_domain.h"
using base::Time; using base::Time;
......
This diff is collapsed.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include "base/string_util.h" #include "base/string_util.h"
#include "base/stringprintf.h" #include "base/stringprintf.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "net/base/cookie_monster.h" #include "net/cookies/cookie_monster.h"
#include "net/base/cookie_monster_store_test.h" #include "net/cookies/cookie_monster_store_test.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace { namespace {
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "net/base/cookie_monster_store_test.h" #include "net/cookies/cookie_monster_store_test.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/message_loop.h" #include "base/message_loop.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file contains test infrastructure for multiple files
// (current cookie_monster_unittest.cc and cookie_monster_perftest.cc)
// that need to test out CookieMonster interactions with the backing store.
// It should only be included by test code.
#ifndef NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_
#define NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_
#pragma once
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "net/cookies/cookie_monster.h"
namespace base {
class Time;
}
namespace net {
// Wrapper class for posting a loaded callback. Since the Callback class is not
// reference counted, we cannot post a callback to the message loop directly,
// instead we post a LoadedCallbackTask.
class LoadedCallbackTask
: public base::RefCountedThreadSafe<LoadedCallbackTask> {
public:
typedef CookieMonster::PersistentCookieStore::LoadedCallback LoadedCallback;
LoadedCallbackTask(LoadedCallback loaded_callback,
std::vector<CookieMonster::CanonicalCookie*> cookies);
~LoadedCallbackTask();
void Run() {
loaded_callback_.Run(cookies_);
}
private:
LoadedCallback loaded_callback_;
std::vector<CookieMonster::CanonicalCookie*> cookies_;
DISALLOW_COPY_AND_ASSIGN(LoadedCallbackTask);
}; // Wrapper class LoadedCallbackTask
// Describes a call to one of the 3 functions of PersistentCookieStore.
struct CookieStoreCommand {
enum Type {
ADD,
UPDATE_ACCESS_TIME,
REMOVE,
};
CookieStoreCommand(Type type,
const CookieMonster::CanonicalCookie& cookie)
: type(type),
cookie(cookie) {}
Type type;
CookieMonster::CanonicalCookie cookie;
};
// Implementation of PersistentCookieStore that captures the
// received commands and saves them to a list.
// The result of calls to Load() can be configured using SetLoadExpectation().
class MockPersistentCookieStore
: public CookieMonster::PersistentCookieStore {
public:
typedef std::vector<CookieStoreCommand> CommandList;
MockPersistentCookieStore();
virtual ~MockPersistentCookieStore();
void SetLoadExpectation(
bool return_value,
const std::vector<CookieMonster::CanonicalCookie*>& result);
const CommandList& commands() const {
return commands_;
}
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
virtual void LoadCookiesForKey(const std::string& key,
const LoadedCallback& loaded_callback) OVERRIDE;
virtual void AddCookie(const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void UpdateCookieAccessTime(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void DeleteCookie(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
// No files are created so nothing to clear either
virtual void SetClearLocalStateOnExit(bool clear_local_state) OVERRIDE;
private:
CommandList commands_;
// Deferred result to use when Load() is called.
bool load_return_value_;
std::vector<CookieMonster::CanonicalCookie*> load_result_;
// Indicates if the store has been fully loaded to avoid returning duplicate
// cookies.
bool loaded_;
DISALLOW_COPY_AND_ASSIGN(MockPersistentCookieStore);
};
// Mock for CookieMonster::Delegate
class MockCookieMonsterDelegate : public CookieMonster::Delegate {
public:
typedef std::pair<CookieMonster::CanonicalCookie, bool>
CookieNotification;
MockCookieMonsterDelegate();
const std::vector<CookieNotification>& changes() const { return changes_; }
void reset() { changes_.clear(); }
virtual void OnCookieChanged(
const CookieMonster::CanonicalCookie& cookie,
bool removed,
CookieMonster::Delegate::ChangeCause cause) OVERRIDE;
private:
virtual ~MockCookieMonsterDelegate();
std::vector<CookieNotification> changes_;
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,
const std::string& cookie_line,
const base::Time& creation_time,
std::vector<CookieMonster::CanonicalCookie*>* out_list);
// Just act like a backing database. Keep cookie information from
// Add/Update/Delete and regurgitate it when Load is called.
class MockSimplePersistentCookieStore
: public CookieMonster::PersistentCookieStore {
public:
MockSimplePersistentCookieStore();
virtual ~MockSimplePersistentCookieStore();
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
virtual void LoadCookiesForKey(const std::string& key,
const LoadedCallback& loaded_callback) OVERRIDE;
virtual void AddCookie(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void UpdateCookieAccessTime(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void DeleteCookie(
const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
virtual void SetClearLocalStateOnExit(bool clear_local_state) OVERRIDE;
private:
typedef std::map<int64, CookieMonster::CanonicalCookie>
CanonicalCookieMap;
CanonicalCookieMap cookies_;
// Indicates if the store has been fully loaded to avoid return duplicate
// cookies in subsequent load requests
bool loaded_;
};
// Helper function for creating a CookieMonster backed by a
// MockSimplePersistentCookieStore for garbage collection testing.
//
// Fill the store through import with |num_cookies| cookies, |num_old_cookies|
// with access time Now()-days_old, the rest with access time Now().
// Do two SetCookies(). Return whether each of the two SetCookies() took
// longer than |gc_perf_micros| to complete, and how many cookie were
// left in the store afterwards.
CookieMonster* CreateMonsterFromStoreForGC(
int num_cookies,
int num_old_cookies,
int days_old);
} // namespace net
#endif // NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "net/base/cookie_store_unittest.h" #include "net/cookies/cookie_store_unittest.h"
#include <time.h> #include <time.h>
#include <string> #include <string>
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/time.h" #include "base/time.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "net/base/cookie_monster.h" #include "net/cookies/cookie_monster.h"
#include "net/base/cookie_monster_store_test.h" // For CookieStore mock #include "net/cookies/cookie_monster_store_test.h" // For CookieStore mock
#include "net/base/cookie_util.h" #include "net/cookies/cookie_util.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Brought to you by number 42.
#ifndef NET_COOKIES_COOKIE_OPTIONS_H_
#define NET_COOKIES_COOKIE_OPTIONS_H_
#pragma once
namespace net {
class CookieOptions {
public:
// Default is to exclude httponly, which means:
// - reading operations will not return httponly cookies.
// - writing operations will not write httponly cookies.
CookieOptions()
: exclude_httponly_(true),
force_session_(false) {
}
void set_exclude_httponly() { exclude_httponly_ = true; }
void set_include_httponly() { exclude_httponly_ = false; }
bool exclude_httponly() const { return exclude_httponly_; }
// Forces a cookie to be saved as a session cookie. If the expiration time of
// the cookie is in the past, i.e. the cookie would end up being deleted, this
// option is ignored. See CookieMonsterTest.ForceSessionOnly.
void set_force_session() { force_session_ = true; }
bool force_session() const { return force_session_; }
private:
bool exclude_httponly_;
bool force_session_;
};
} // namespace net
#endif // NET_COOKIES_COOKIE_OPTIONS_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "net/base/cookie_store.h" #include "net/cookies/cookie_store.h"
#include "net/base/cookie_options.h" #include "net/cookies/cookie_options.h"
namespace net { namespace net {
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Brought to you by number 42.
#ifndef NET_COOKIES_COOKIE_STORE_H_
#define NET_COOKIES_COOKIE_STORE_H_
#pragma once
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
#include "net/cookies/cookie_options.h"
#include "net/base/net_export.h"
class GURL;
namespace net {
class CookieMonster;
// An interface for storing and retrieving cookies. Implementations need to
// be thread safe as its methods can be accessed from IO as well as UI threads.
class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
public:
// This struct contains additional consumer-specific information that might
// be stored with cookies; currently just MAC information, see:
// http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac
struct NET_EXPORT CookieInfo {
CookieInfo();
~CookieInfo();
// The name of the cookie.
std::string name;
// TODO(abarth): Add value if any clients need it.
// The time at which the cookie was created.
base::Time creation_date;
// The value of the MAC-Key and MAC-Algorithm attributes, if present.
std::string mac_key;
std::string mac_algorithm;
};
// Callback definitions.
typedef base::Callback <void(
const std::string& cookie_line,
const std::vector<CookieInfo>& cookie_infos)> GetCookieInfoCallback;
typedef base::Callback<void(const std::string& cookie)>
GetCookiesCallback;
typedef base::Callback<void(bool success)> SetCookiesCallback;
typedef base::Callback<void(int num_deleted)> DeleteCallback;
// Sets a single cookie. Expects a cookie line, like "a=1; domain=b.com".
//
// Fails either if the cookie is invalid or if this is a non-HTTPONLY cookie
// and it would overwrite an existing HTTPONLY cookie.
// Returns true if the cookie is successfully set.
virtual void SetCookieWithOptionsAsync(
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
const SetCookiesCallback& callback) = 0;
// TODO(???): what if the total size of all the cookies >4k, can we have a
// header that big or do we need multiple Cookie: headers?
// Note: Some sites, such as Facebook, occasionally use Cookie headers >4k.
//
// Simple interface, gets a cookie string "a=b; c=d" for the given URL.
// Use options to access httponly cookies.
virtual void GetCookiesWithOptionsAsync(
const GURL& url, const CookieOptions& options,
const GetCookiesCallback& callback) = 0;
// This function is similar to GetCookiesWithOptions same functionality as
// GetCookiesWithOptions except that it additionally provides detailed
// information about the cookie contained in the cookie line. See |struct
// CookieInfo| above for details.
virtual void GetCookiesWithInfoAsync(
const GURL& url,
const CookieOptions& options,
const GetCookieInfoCallback& callback) = 0;
// Deletes the passed in cookie for the specified URL.
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) = 0;
// Deletes all of the cookies that have a creation_date greater than or equal
// to |delete_begin| and less than |delete_end|
// Returns the number of cookies that have been deleted.
virtual void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
const base::Time& delete_end,
const DeleteCallback& callback) = 0;
// Returns the underlying CookieMonster.
virtual CookieMonster* GetCookieMonster() = 0;
protected:
friend class base::RefCountedThreadSafe<CookieStore>;
CookieStore();
virtual ~CookieStore();
};
} // namespace net
#endif // NET_COOKIES_COOKIE_STORE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "net/base/cookie_store_test_callbacks.h" #include "net/cookies/cookie_store_test_callbacks.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_COOKIES_COOKIE_STORE_TEST_CALLBACKS_H_
#define NET_COOKIES_COOKIE_STORE_TEST_CALLBACKS_H_
#pragma once
#include <string>
#include <vector>
#include "net/cookies/cookie_store.h"
class MessageLoop;
namespace base {
class Thread;
}
namespace net {
// Defines common behaviour for the callbacks from GetCookies, SetCookies, etc.
// Asserts that the current thread is the expected invocation thread, sends a
// quit to the thread in which it was constructed.
class CookieCallback {
public:
// Indicates whether the callback has been called.
bool did_run() { return did_run_; }
protected:
// Constructs a callback that expects to be called in the given thread and
// will, upon execution, send a QUIT to the constructing thread.
explicit CookieCallback(base::Thread* run_in_thread);
// Constructs a callback that expects to be called in current thread and will
// send a QUIT to the constructing thread.
CookieCallback();
// Tests whether the current thread was the caller's thread.
// Sends a QUIT to the constructing thread.
void CallbackEpilogue();
private:
bool did_run_;
base::Thread* run_in_thread_;
MessageLoop* run_in_loop_;
MessageLoop* parent_loop_;
MessageLoop* loop_to_quit_;
};
// Callback implementations for the asynchronous CookieStore methods.
class SetCookieCallback : public CookieCallback {
public:
SetCookieCallback();
explicit SetCookieCallback(base::Thread* run_in_thread);
void Run(bool result) {
result_ = result;
CallbackEpilogue();
}
bool result() { return result_; }
private:
bool result_;
};
class GetCookieStringCallback : public CookieCallback {
public:
GetCookieStringCallback();
explicit GetCookieStringCallback(base::Thread* run_in_thread);
void Run(const std::string& cookie) {
cookie_ = cookie;
CallbackEpilogue();
}
const std::string& cookie() { return cookie_; }
private:
std::string cookie_;
};
class GetCookiesWithInfoCallback : public CookieCallback {
public:
GetCookiesWithInfoCallback();
explicit GetCookiesWithInfoCallback(base::Thread* run_in_thread);
~GetCookiesWithInfoCallback();
void Run(
const std::string& cookie_line,
const std::vector<CookieStore::CookieInfo>& cookie_info) {
cookie_line_ = cookie_line;
cookie_info_ = cookie_info;
CallbackEpilogue();
}
const std::string& cookie_line() { return cookie_line_; }
const std::vector<CookieStore::CookieInfo>& cookie_info() {
return cookie_info_;
}
private:
std::string cookie_line_;
std::vector<CookieStore::CookieInfo> cookie_info_;
};
class DeleteCallback : public CookieCallback {
public:
DeleteCallback();
explicit DeleteCallback(base::Thread* run_in_thread);
void Run(int num_deleted) {
num_deleted_ = num_deleted;
CallbackEpilogue();
}
int num_deleted() { return num_deleted_; }
private:
int num_deleted_;
};
class DeleteCookieCallback : public CookieCallback {
public:
DeleteCookieCallback();
explicit DeleteCookieCallback(base::Thread* run_in_thread);
void Run() {
CallbackEpilogue();
}
};
} // namespace net
#endif // NET_COOKIES_COOKIE_STORE_TEST_CALLBACKS_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "net/base/cookie_store_test_helpers.h" #include "net/cookies/cookie_store_test_helpers.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/message_loop.h" #include "base/message_loop.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
#define NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
#pragma once
#include "net/cookies/cookie_monster.h"
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
class DelayedCookieMonster : public CookieStore {
public:
DelayedCookieMonster();
// Call the asynchronous CookieMonster function, expect it to immediately
// invoke the internal callback.
// Post a delayed task to invoke the original callback with the results.
virtual void SetCookieWithOptionsAsync(
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
const CookieMonster::SetCookiesCallback& callback) OVERRIDE;
virtual void GetCookiesWithOptionsAsync(
const GURL& url, const CookieOptions& options,
const CookieMonster::GetCookiesCallback& callback) OVERRIDE;
virtual void GetCookiesWithInfoAsync(
const GURL& url,
const CookieOptions& options,
const CookieMonster::GetCookieInfoCallback& callback) OVERRIDE;
virtual bool SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
const CookieOptions& options);
virtual std::string GetCookiesWithOptions(const GURL& url,
const CookieOptions& options);
virtual void GetCookiesWithInfo(const GURL& url,
const CookieOptions& options,
std::string* cookie_line,
std::vector<CookieInfo>* cookie_infos);
virtual void DeleteCookie(const GURL& url,
const std::string& cookie_name);
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) OVERRIDE;
virtual void DeleteAllCreatedBetweenAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
const DeleteCallback& callback) OVERRIDE;
virtual CookieMonster* GetCookieMonster() OVERRIDE;
private:
// Be called immediately from CookieMonster.
void GetCookiesInternalCallback(
const std::string& cookie_line,
const std::vector<CookieStore::CookieInfo>& cookie_info);
void SetCookiesInternalCallback(bool result);
void GetCookiesWithOptionsInternalCallback(const std::string& cookie);
// Invoke the original callbacks.
void InvokeGetCookiesCallback(
const CookieMonster::GetCookieInfoCallback& callback);
void InvokeSetCookiesCallback(
const CookieMonster::SetCookiesCallback& callback);
void InvokeGetCookieStringCallback(
const CookieMonster::GetCookiesCallback& callback);
friend class base::RefCountedThreadSafe<DelayedCookieMonster>;
virtual ~DelayedCookieMonster();
scoped_refptr<CookieMonster> cookie_monster_;
bool did_run_;
bool result_;
std::string cookie_;
std::string cookie_line_;
std::vector<CookieStore::CookieInfo> cookie_info_;
};
} // namespace net
#endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
This diff is collapsed.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "net/base/cookie_util.h" #include "net/cookies/cookie_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_COOKIES_COOKIE_UTIL_H_
#define NET_COOKIES_COOKIE_UTIL_H_
#pragma once
#include <string>
#include "net/base/net_export.h"
class GURL;
namespace net {
namespace cookie_util {
// Returns the effective TLD+1 for a given host. This only makes sense for http
// and https schemes. For other schemes, the host will be returned unchanged
// (minus any leading period).
NET_EXPORT std::string GetEffectiveDomain(const std::string& scheme,
const std::string& host);
// Determine the actual cookie domain based on the domain string passed
// (if any) and the URL from which the cookie came.
// On success returns true, and sets cookie_domain to either a
// -host cookie domain (ex: "google.com")
// -domain cookie domain (ex: ".google.com")
NET_EXPORT bool GetCookieDomainWithString(const GURL& url,
const std::string& domain_string,
std::string* result);
// Returns true if a domain string represents a host-only cookie,
// i.e. it doesn't begin with a leading '.' character.
NET_EXPORT bool DomainIsHostOnly(const std::string& domain_string);
} // namspace cookie_util
} // namespace net
#endif // NET_COOKIES_COOKIE_UTIL_H_
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "base/basictypes.h" #include "base/basictypes.h"
#include "net/base/cookie_util.h" #include "net/cookies/cookie_util.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
TEST(CookieUtilTest, TestDomainIsHostOnly) { TEST(CookieUtilTest, TestDomainIsHostOnly) {
......
...@@ -75,13 +75,6 @@ ...@@ -75,13 +75,6 @@
'base/completion_callback.h', 'base/completion_callback.h',
'base/connection_type_histograms.cc', 'base/connection_type_histograms.cc',
'base/connection_type_histograms.h', 'base/connection_type_histograms.h',
'base/cookie_monster.cc',
'base/cookie_monster.h',
'base/cookie_options.h',
'base/cookie_store.cc',
'base/cookie_store.h',
'base/cookie_util.cc',
'base/cookie_util.h',
'base/crl_set.cc', 'base/crl_set.cc',
'base/crl_set.h', 'base/crl_set.h',
'base/crypto_module.h', 'base/crypto_module.h',
...@@ -276,6 +269,13 @@ ...@@ -276,6 +269,13 @@
'base/x509_util_openssl.h', 'base/x509_util_openssl.h',
'base/zap.cc', 'base/zap.cc',
'base/zap.h', 'base/zap.h',
'cookies/cookie_monster.cc',
'cookies/cookie_monster.h',
'cookies/cookie_options.h',
'cookies/cookie_store.cc',
'cookies/cookie_store.h',
'cookies/cookie_util.cc',
'cookies/cookie_util.h',
'disk_cache/addr.cc', 'disk_cache/addr.cc',
'disk_cache/addr.h', 'disk_cache/addr.h',
'disk_cache/backend_impl.cc', 'disk_cache/backend_impl.cc',
...@@ -1023,9 +1023,6 @@ ...@@ -1023,9 +1023,6 @@
'base/big_endian_unittest.cc', 'base/big_endian_unittest.cc',
'base/cert_database_nss_unittest.cc', 'base/cert_database_nss_unittest.cc',
'base/cert_verifier_unittest.cc', 'base/cert_verifier_unittest.cc',
'base/cookie_monster_unittest.cc',
'base/cookie_store_unittest.h',
'base/cookie_util_unittest.cc',
'base/crl_set_unittest.cc', 'base/crl_set_unittest.cc',
'base/data_url_unittest.cc', 'base/data_url_unittest.cc',
'base/default_origin_bound_cert_store_unittest.cc', 'base/default_origin_bound_cert_store_unittest.cc',
...@@ -1079,6 +1076,9 @@ ...@@ -1079,6 +1076,9 @@
'base/x509_cert_types_unittest.cc', 'base/x509_cert_types_unittest.cc',
'base/x509_util_nss_unittest.cc', 'base/x509_util_nss_unittest.cc',
'base/x509_util_openssl_unittest.cc', 'base/x509_util_openssl_unittest.cc',
'cookies/cookie_monster_unittest.cc',
'cookies/cookie_store_unittest.h',
'cookies/cookie_util_unittest.cc',
'disk_cache/addr_unittest.cc', 'disk_cache/addr_unittest.cc',
'disk_cache/backend_unittest.cc', 'disk_cache/backend_unittest.cc',
'disk_cache/bitmap_unittest.cc', 'disk_cache/bitmap_unittest.cc',
...@@ -1428,7 +1428,7 @@ ...@@ -1428,7 +1428,7 @@
'../testing/gtest.gyp:gtest', '../testing/gtest.gyp:gtest',
], ],
'sources': [ 'sources': [
'base/cookie_monster_perftest.cc', 'cookies/cookie_monster_perftest.cc',
'disk_cache/disk_cache_perftest.cc', 'disk_cache/disk_cache_perftest.cc',
'proxy/proxy_resolver_perftest.cc', 'proxy/proxy_resolver_perftest.cc',
], ],
...@@ -1510,12 +1510,6 @@ ...@@ -1510,12 +1510,6 @@
'sources': [ 'sources': [
'base/cert_test_util.cc', 'base/cert_test_util.cc',
'base/cert_test_util.h', 'base/cert_test_util.h',
'base/cookie_monster_store_test.cc',
'base/cookie_monster_store_test.h',
'base/cookie_store_test_callbacks.cc',
'base/cookie_store_test_callbacks.h',
'base/cookie_store_test_helpers.cc',
'base/cookie_store_test_helpers.h',
'base/mock_file_stream.cc', 'base/mock_file_stream.cc',
'base/mock_file_stream.h', 'base/mock_file_stream.h',
'base/mock_host_resolver.cc', 'base/mock_host_resolver.cc',
...@@ -1524,6 +1518,12 @@ ...@@ -1524,6 +1518,12 @@
'base/net_test_suite.h', 'base/net_test_suite.h',
'base/test_completion_callback.cc', 'base/test_completion_callback.cc',
'base/test_completion_callback.h', 'base/test_completion_callback.h',
'cookies/cookie_monster_store_test.cc',
'cookies/cookie_monster_store_test.h',
'cookies/cookie_store_test_callbacks.cc',
'cookies/cookie_store_test_callbacks.h',
'cookies/cookie_store_test_helpers.cc',
'cookies/cookie_store_test_helpers.h',
'disk_cache/disk_cache_test_base.cc', 'disk_cache/disk_cache_test_base.cc',
'disk_cache/disk_cache_test_base.h', 'disk_cache/disk_cache_test_base.h',
'disk_cache/disk_cache_test_util.cc', 'disk_cache/disk_cache_test_util.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment