summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/WebRequestContext.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-10-25 12:20:52 +0100
committerSteve Block <steveblock@google.com>2010-10-27 19:46:29 +0100
commit965d128a2f803da81a8a6d04c3d79382ff827bb9 (patch)
treed5912955a57cbfd3d43229c4c9848f9bd525862e /WebKit/android/WebCoreSupport/WebRequestContext.h
parent43d943757c6b39710fa65034351bc2e84946e8ce (diff)
downloadexternal_webkit-965d128a2f803da81a8a6d04c3d79382ff827bb9.zip
external_webkit-965d128a2f803da81a8a6d04c3d79382ff827bb9.tar.gz
external_webkit-965d128a2f803da81a8a6d04c3d79382ff827bb9.tar.bz2
Hook up CookieManager.acceptCookie() and setAcceptCookie() for the Chromium HTTP stack
We also update PlatformBridge::cookiesEnabled() to query the Chromium HTTP stack directly. This avoids calling CookieClient::cookiesEnabled(), which calls the Java CookieManager::acceptCookie() which in turns calls back to native code. Also requires a change to frameworks/base ... https://android-git.corp.google.com/g/76065 Bug: 3116410 Change-Id: Id853463f3bcef76b220e8c44dd2b30c0d6752624
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebRequestContext.h')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.h b/WebKit/android/WebCoreSupport/WebRequestContext.h
index 788998e..f4a579c 100644
--- a/WebKit/android/WebCoreSupport/WebRequestContext.h
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.h
@@ -29,14 +29,20 @@
#include "ChromiumIncludes.h"
#include "PlatformString.h"
+#include <wtf/ThreadingPrimitives.h>
+
namespace android {
-class WebRequestContext : public URLRequestContext {
+class WebRequestContext : public URLRequestContext, net::CookiePolicy {
public:
// URLRequestContext overrides.
virtual const std::string& GetUserAgent(const GURL&) const;
virtual const std::string& GetAcceptLanguage() const;
+ // CookiePolicy implementation.
+ virtual int CanGetCookies(const GURL& url, const GURL& first_party_for_cookies, net::CompletionCallback*);
+ virtual int CanSetCookie(const GURL& url, const GURL& first_party_for_cookies, const std::string& cookie_line, net::CompletionCallback*);
+
// Lazily create the relevant context. This class holds a reference.
// This may be called on any thread. The context returned, however, is not
// threadsafe, and should only be used on a single thread (the network stack
@@ -47,6 +53,8 @@ public:
static bool cleanupPrivateBrowsingFiles(const std::string& databaseDirectory, const std::string& cacheDirectory);
static void setUserAgent(WTF::String);
static void setAcceptLanguage(WTF::String);
+ bool allowCookies();
+ void setAllowCookies(bool allow);
private:
WebRequestContext();
@@ -55,6 +63,9 @@ private:
static WebRequestContext* getContextForPath(const char* cookieFilename, const char* cacheFilename);
static WebRequestContext* getRegularContext();
static WebRequestContext* getPrivateBrowsingContext();
+
+ bool m_allowCookies;
+ WTF::Mutex m_allowCookiesMutex;
};
} // namespace android