diff options
author | Iain Merrick <husky@google.com> | 2010-12-06 10:43:52 +0000 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-12-06 16:09:54 +0000 |
commit | c65c296d5bbf1608aedeceac90179a261deb0368 (patch) | |
tree | e9178ab9aaf50ba7472a89708e5cb7e9c1921fd9 /WebKit/android/WebCoreSupport/WebCookieJar.cpp | |
parent | b552bd9285b27da2142b3078a06bdfe022a59410 (diff) | |
download | external_webkit-c65c296d5bbf1608aedeceac90179a261deb0368.zip external_webkit-c65c296d5bbf1608aedeceac90179a261deb0368.tar.gz external_webkit-c65c296d5bbf1608aedeceac90179a261deb0368.tar.bz2 |
Fix CookieManager.hasCookies().
To pass the CTS test, this method needs to check the persistent
database directly, ignoring any cookies that are only stored in
memory.
Depends on change Id498d281 in external/chromium, which adds the
GetCookieCount() method.
Change-Id: Ibeceaaa9942b5f4f1160fc2eeeca8b2322169a90
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebCookieJar.cpp')
-rw-r--r-- | WebKit/android/WebCoreSupport/WebCookieJar.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/WebKit/android/WebCoreSupport/WebCookieJar.cpp b/WebKit/android/WebCoreSupport/WebCookieJar.cpp index 6a81ff1..afa87c2 100644 --- a/WebKit/android/WebCoreSupport/WebCookieJar.cpp +++ b/WebKit/android/WebCoreSupport/WebCookieJar.cpp @@ -95,8 +95,8 @@ WebCookieJar::WebCookieJar(const std::string& databaseFilePath) net::CookieMonster::EnableFileScheme(); FilePath cookiePath(databaseFilePath.c_str()); - scoped_refptr<SQLitePersistentCookieStore> cookieDb = new SQLitePersistentCookieStore(cookiePath); - m_cookieStore = new net::CookieMonster(cookieDb.get(), 0); + m_cookieDb = new SQLitePersistentCookieStore(cookiePath); + m_cookieStore = new net::CookieMonster(m_cookieDb.get(), 0); } bool WebCookieJar::allowCookies() @@ -111,6 +111,11 @@ void WebCookieJar::setAllowCookies(bool allow) m_allowCookies = allow; } +int WebCookieJar::getNumCookiesInDatabase() +{ + return m_cookieDb ? m_cookieDb->GetCookieCount() : 0; +} + // From CookiePolicy in chromium int WebCookieJar::CanGetCookies(const GURL&, const GURL&, net::CompletionCallback*) { |