summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 16:04:50 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 16:04:50 +0000
commit34d18e40e285579af3b5fae02ad21ce3d94745be (patch)
treef69d053360091d15a6adef6095c54f947a113812 /net
parent379418079f6f422db211d61f1b1142e4025b730c (diff)
downloadchromium_src-34d18e40e285579af3b5fae02ad21ce3d94745be.zip
chromium_src-34d18e40e285579af3b5fae02ad21ce3d94745be.tar.gz
chromium_src-34d18e40e285579af3b5fae02ad21ce3d94745be.tar.bz2
Revert 50296 (Causes DCHECK failures) - Make CookieMonster NonThreadSafe.
Made ExtensionFunction RefCountedThreadSafe so it can be posted to different threads. Used WaitableEvent in AutomationProvider. BUG=44083 Review URL: http://codereview.chromium.org/2756003 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/2860012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rwxr-xr-xnet/base/cookie_monster.cc13
-rw-r--r--net/base/cookie_monster.h12
2 files changed, 2 insertions, 23 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc
index a4f0953..fbc0877 100755
--- a/net/base/cookie_monster.cc
+++ b/net/base/cookie_monster.cc
@@ -549,7 +549,6 @@ bool CookieMonster::HasCookieableScheme(const GURL& url) {
void CookieMonster::SetCookieableSchemes(
const char* schemes[], size_t num_schemes) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
// Cookieable Schemes must be set before first use of function.
@@ -565,7 +564,6 @@ bool CookieMonster::SetCookieWithCreationTimeAndOptions(
const std::string& cookie_line,
const Time& creation_time_or_null,
const CookieOptions& options) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
if (!HasCookieableScheme(url)) {
@@ -621,7 +619,6 @@ bool CookieMonster::SetCookieWithDetails(
const GURL& url, const std::string& name, const std::string& value,
const std::string& domain, const std::string& path,
const base::Time& expiration_time, bool secure, bool http_only) {
- DCHECK(CalledOnValidThread());
// Expect a valid domain attribute with no illegal characters.
std::string parsed_domain = ParsedCookie::ParseValueString(domain);
@@ -839,7 +836,6 @@ int CookieMonster::GarbageCollectExpired(
}
int CookieMonster::DeleteAll(bool sync_to_store) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -857,7 +853,6 @@ int CookieMonster::DeleteAll(bool sync_to_store) {
int CookieMonster::DeleteAllCreatedBetween(const Time& delete_begin,
const Time& delete_end,
bool sync_to_store) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -879,13 +874,11 @@ int CookieMonster::DeleteAllCreatedBetween(const Time& delete_begin,
int CookieMonster::DeleteAllCreatedAfter(const Time& delete_begin,
bool sync_to_store) {
- DCHECK(CalledOnValidThread());
return DeleteAllCreatedBetween(delete_begin, Time(), sync_to_store);
}
int CookieMonster::DeleteAllForURL(const GURL& url,
bool sync_to_store) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -902,7 +895,6 @@ int CookieMonster::DeleteAllForURL(const GURL& url,
bool CookieMonster::DeleteCookie(const std::string& domain,
const CanonicalCookie& cookie,
bool sync_to_store) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -930,7 +922,6 @@ static bool CookieSorter(CookieMonster::CanonicalCookie* cc1,
bool CookieMonster::SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
const CookieOptions& options) {
- DCHECK(CalledOnValidThread());
return SetCookieWithCreationTimeAndOptions(url, cookie_line, Time(), options);
}
@@ -948,7 +939,6 @@ bool CookieMonster::SetCookieWithOptions(const GURL& url,
// should be fast and simple enough for now.
std::string CookieMonster::GetCookiesWithOptions(const GURL& url,
const CookieOptions& options) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -981,7 +971,6 @@ std::string CookieMonster::GetCookiesWithOptions(const GURL& url,
void CookieMonster::DeleteCookie(const GURL& url,
const std::string& cookie_name) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -1013,7 +1002,6 @@ void CookieMonster::DeleteCookie(const GURL& url,
}
CookieMonster::CookieList CookieMonster::GetAllCookies() {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
@@ -1037,7 +1025,6 @@ CookieMonster::CookieList CookieMonster::GetAllCookies() {
}
CookieMonster::CookieList CookieMonster::GetAllCookiesForURL(const GURL& url) {
- DCHECK(CalledOnValidThread());
AutoLock autolock(lock_);
InitIfNecessary();
diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h
index 109fe94..ee869e9 100644
--- a/net/base/cookie_monster.h
+++ b/net/base/cookie_monster.h
@@ -14,8 +14,6 @@
#include "base/basictypes.h"
#include "base/lock.h"
-#include "base/logging.h"
-#include "base/non_thread_safe.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/time.h"
@@ -35,7 +33,7 @@ namespace net {
//
// TODO(deanm) Implement CookieMonster, the cookie database.
// - Verify that our domain enforcement and non-dotted handling is correct
-class CookieMonster : public CookieStore, NonThreadSafe {
+class CookieMonster : public CookieStore {
public:
class CanonicalCookie;
class Delegate;
@@ -90,10 +88,7 @@ class CookieMonster : public CookieStore, NonThreadSafe {
virtual std::string GetCookiesWithOptions(const GURL& url,
const CookieOptions& options);
virtual void DeleteCookie(const GURL& url, const std::string& cookie_name);
- virtual CookieMonster* GetCookieMonster() {
- DCHECK(CalledOnValidThread());
- return this;
- }
+ virtual CookieMonster* GetCookieMonster() { return this; }
// Sets a cookie given explicit user-provided cookie attributes. The cookie
// name, value, domain, etc. are each provided as separate strings. This
@@ -117,7 +112,6 @@ class CookieMonster : public CookieStore, NonThreadSafe {
bool SetCookieWithCreationTime(const GURL& url,
const std::string& cookie_line,
const base::Time& creation_time) {
- DCHECK(CalledOnValidThread());
return SetCookieWithCreationTimeAndOptions(url, cookie_line, creation_time,
CookieOptions());
}
@@ -289,8 +283,6 @@ class CookieMonster : public CookieStore, NonThreadSafe {
scoped_refptr<Delegate> delegate_;
- // TODO(willchan): Remove this lock after making sure CookieMonster is
- // completely single threaded.
// Lock for thread-safety
Lock lock_;