OSDN Git Service

Merge Chromium at r12.0.742.93: CookiePolicy update
authorKristian Monsen <kristianm@google.com>
Thu, 7 Jul 2011 14:44:56 +0000 (15:44 +0100)
committerKristian Monsen <kristianm@google.com>
Thu, 7 Jul 2011 16:21:23 +0000 (17:21 +0100)
Async functionality removed, and const added. Needed to make
the Mutex mutable so it can be changed in the const function.

Chromium CL:
http://src.chromium.org/viewvc/chrome/branches/742/src/net/base/cookie_policy.h?view=diff&pathrev=88489&r1=80659&r2=80660

Change-Id: Ib8898076cd6a22ccac4f719bc9ed437bf36d7b44

Source/WebKit/android/WebCoreSupport/WebCookieJar.cpp
Source/WebKit/android/WebCoreSupport/WebCookieJar.h

index dfb249d..1dc4637 100644 (file)
@@ -165,14 +165,14 @@ int WebCookieJar::getNumCookiesInDatabase()
 }
 
 // From CookiePolicy in chromium
-int WebCookieJar::CanGetCookies(const GURL&, const GURL&, net::CompletionCallback*)
+int WebCookieJar::CanGetCookies(const GURL&, const GURL&) const
 {
     MutexLocker lock(m_allowCookiesMutex);
     return m_allowCookies ? net::OK : net::ERR_ACCESS_DENIED;
 }
 
 // From CookiePolicy in chromium
-int WebCookieJar::CanSetCookie(const GURL&, const GURL&, const std::string&, net::CompletionCallback*)
+int WebCookieJar::CanSetCookie(const GURL&, const GURL&, const std::string&) const
 {
     MutexLocker lock(m_allowCookiesMutex);
     return m_allowCookies ? net::OK : net::ERR_ACCESS_DENIED;
index 1f4266c..b6490af 100644 (file)
@@ -43,8 +43,8 @@ public:
     static void flush();
 
     // CookiePolicy implementation from external/chromium
-    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*);
+    virtual int CanGetCookies(const GURL& url, const GURL& first_party_for_cookies) const;
+    virtual int CanSetCookie(const GURL& url, const GURL& first_party_for_cookies, const std::string& cookie_line) const;
 
     bool allowCookies();
     void setAllowCookies(bool allow);
@@ -70,7 +70,7 @@ private:
     scoped_refptr<SQLitePersistentCookieStore> m_cookieDb;
     scoped_refptr<net::CookieStore> m_cookieStore;
     bool m_allowCookies;
-    WTF::Mutex m_allowCookiesMutex;
+    mutable WTF::Mutex m_allowCookiesMutex;
 };
 
 }