summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/network
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-16 16:25:10 +0100
committerBen Murdoch <benm@google.com>2011-05-23 18:54:14 +0100
commitab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch)
treedb769fadd053248f85db67434a5b275224defef7 /Source/WebCore/platform/network
parent52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff)
downloadexternal_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebCore/platform/network')
-rw-r--r--Source/WebCore/platform/network/BlobData.h1
-rw-r--r--Source/WebCore/platform/network/FormDataBuilder.h4
-rw-r--r--Source/WebCore/platform/network/NetworkStateNotifier.h4
-rw-r--r--Source/WebCore/platform/network/ResourceHandleInternal.h3
-rw-r--r--Source/WebCore/platform/network/ResourceRequestBase.h8
-rw-r--r--Source/WebCore/platform/network/ResourceResponseBase.h8
-rw-r--r--Source/WebCore/platform/network/cf/CookieJarCFNet.cpp63
-rw-r--r--Source/WebCore/platform/network/chromium/CookieJarChromium.cpp14
-rw-r--r--Source/WebCore/platform/network/chromium/DNSChromium.cpp4
-rw-r--r--Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp3
-rw-r--r--Source/WebCore/platform/network/win/ResourceHandleWin.cpp3
11 files changed, 88 insertions, 27 deletions
diff --git a/Source/WebCore/platform/network/BlobData.h b/Source/WebCore/platform/network/BlobData.h
index 1ff6344..c1f5522 100644
--- a/Source/WebCore/platform/network/BlobData.h
+++ b/Source/WebCore/platform/network/BlobData.h
@@ -145,6 +145,7 @@ private:
typedef Vector<BlobDataItem> BlobDataItemList;
class BlobData {
+ WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<BlobData> create();
diff --git a/Source/WebCore/platform/network/FormDataBuilder.h b/Source/WebCore/platform/network/FormDataBuilder.h
index 87d0ef3..112e315 100644
--- a/Source/WebCore/platform/network/FormDataBuilder.h
+++ b/Source/WebCore/platform/network/FormDataBuilder.h
@@ -23,14 +23,14 @@
#include "PlatformString.h"
#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
namespace WebCore {
class Document;
class TextEncoding;
-class FormDataBuilder : public Noncopyable {
+class FormDataBuilder {
+ WTF_MAKE_NONCOPYABLE(FormDataBuilder);
public:
static TextEncoding encodingFromAcceptCharset(const String& acceptCharset, Document* document);
diff --git a/Source/WebCore/platform/network/NetworkStateNotifier.h b/Source/WebCore/platform/network/NetworkStateNotifier.h
index 21d0067..08ab0bd 100644
--- a/Source/WebCore/platform/network/NetworkStateNotifier.h
+++ b/Source/WebCore/platform/network/NetworkStateNotifier.h
@@ -26,6 +26,7 @@
#ifndef NetworkStateNotifier_h
#define NetworkStateNotifier_h
+#include <wtf/FastAllocBase.h>
#include <wtf/Noncopyable.h>
#if PLATFORM(ANDROID)
// TODO: Upstream to webkit.org
@@ -65,7 +66,8 @@ namespace WebCore {
class NetworkStateNotifierPrivate;
#endif
-class NetworkStateNotifier : public Noncopyable {
+class NetworkStateNotifier {
+ WTF_MAKE_NONCOPYABLE(NetworkStateNotifier); WTF_MAKE_FAST_ALLOCATED;
public:
NetworkStateNotifier();
void setNetworkStateChangedFunction(void (*)());
diff --git a/Source/WebCore/platform/network/ResourceHandleInternal.h b/Source/WebCore/platform/network/ResourceHandleInternal.h
index d833e32..ed66944 100644
--- a/Source/WebCore/platform/network/ResourceHandleInternal.h
+++ b/Source/WebCore/platform/network/ResourceHandleInternal.h
@@ -80,7 +80,8 @@ class NSURLConnection;
namespace WebCore {
class ResourceHandleClient;
- class ResourceHandleInternal : public Noncopyable {
+ class ResourceHandleInternal {
+ WTF_MAKE_NONCOPYABLE(ResourceHandleInternal); WTF_MAKE_FAST_ALLOCATED;
public:
ResourceHandleInternal(ResourceHandle* loader, const ResourceRequest& request, ResourceHandleClient* c, bool defersLoading, bool shouldContentSniff)
: m_client(c)
diff --git a/Source/WebCore/platform/network/ResourceRequestBase.h b/Source/WebCore/platform/network/ResourceRequestBase.h
index 5cb7ee3..dce33db 100644
--- a/Source/WebCore/platform/network/ResourceRequestBase.h
+++ b/Source/WebCore/platform/network/ResourceRequestBase.h
@@ -49,7 +49,8 @@ namespace WebCore {
struct CrossThreadResourceRequestData;
// Do not use this type directly. Use ResourceRequest instead.
- class ResourceRequestBase : public FastAllocBase {
+ class ResourceRequestBase {
+ WTF_MAKE_FAST_ALLOCATED;
public:
// The type of this ResourceRequest, based on how the resource will be used.
enum TargetType {
@@ -207,7 +208,10 @@ namespace WebCore {
inline bool operator==(const ResourceRequest& a, const ResourceRequest& b) { return ResourceRequestBase::compare(a, b); }
inline bool operator!=(ResourceRequest& a, const ResourceRequest& b) { return !(a == b); }
- struct CrossThreadResourceRequestDataBase : Noncopyable {
+ struct CrossThreadResourceRequestDataBase {
+ WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestDataBase); WTF_MAKE_FAST_ALLOCATED;
+ public:
+ CrossThreadResourceRequestDataBase() { }
KURL m_url;
ResourceRequestCachePolicy m_cachePolicy;
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h
index 9c54bab..e0774c2 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.h
+++ b/Source/WebCore/platform/network/ResourceResponseBase.h
@@ -41,7 +41,8 @@ class ResourceResponse;
struct CrossThreadResourceResponseData;
// Do not use this class directly, use the class ResponseResponse instead
-class ResourceResponseBase : public FastAllocBase {
+class ResourceResponseBase {
+ WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<ResourceResponse> adopt(PassOwnPtr<CrossThreadResourceResponseData>);
@@ -175,7 +176,10 @@ private:
inline bool operator==(const ResourceResponse& a, const ResourceResponse& b) { return ResourceResponseBase::compare(a, b); }
inline bool operator!=(const ResourceResponse& a, const ResourceResponse& b) { return !(a == b); }
-struct CrossThreadResourceResponseDataBase : Noncopyable {
+struct CrossThreadResourceResponseDataBase {
+ WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseDataBase);
+public:
+ CrossThreadResourceResponseDataBase() { }
KURL m_url;
String m_mimeType;
long long m_expectedContentLength;
diff --git a/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp b/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp
index 659b719..c6d513a 100644
--- a/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp
+++ b/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp
@@ -34,6 +34,7 @@
#include "KURL.h"
#include "PlatformString.h"
#include "ResourceHandle.h"
+#include "SoftLinking.h"
#include <CFNetwork/CFHTTPCookiesPriv.h>
#include <CoreFoundation/CoreFoundation.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
@@ -44,6 +45,53 @@ namespace WebCore {
static const CFStringRef s_setCookieKeyCF = CFSTR("Set-Cookie");
static const CFStringRef s_cookieCF = CFSTR("Cookie");
+#ifdef DEBUG_ALL
+SOFT_LINK_DEBUG_LIBRARY(CFNetwork)
+#else
+SOFT_LINK_LIBRARY(CFNetwork)
+#endif
+
+SOFT_LINK_OPTIONAL(CFNetwork, CFHTTPCookieCopyDomain, CFStringRef, __cdecl, (CFHTTPCookieRef))
+SOFT_LINK_OPTIONAL(CFNetwork, CFHTTPCookieGetExpirationTime, CFAbsoluteTime, __cdecl, (CFHTTPCookieRef))
+SOFT_LINK_OPTIONAL(CFNetwork, CFHTTPCookieCopyName, CFStringRef, __cdecl, (CFHTTPCookieRef))
+SOFT_LINK_OPTIONAL(CFNetwork, CFHTTPCookieCopyPath, CFStringRef, __cdecl, (CFHTTPCookieRef))
+SOFT_LINK_OPTIONAL(CFNetwork, CFHTTPCookieCopyValue, CFStringRef, __cdecl, (CFHTTPCookieRef))
+
+static inline RetainPtr<CFStringRef> cookieDomain(CFHTTPCookieRef cookie)
+{
+ if (CFHTTPCookieCopyDomainPtr())
+ return RetainPtr<CFStringRef>(AdoptCF, CFHTTPCookieCopyDomainPtr()(cookie));
+ return CFHTTPCookieGetDomain(cookie);
+}
+
+static inline CFAbsoluteTime cookieExpirationTime(CFHTTPCookieRef cookie)
+{
+ if (CFHTTPCookieGetExpirationTimePtr())
+ return CFHTTPCookieGetExpirationTimePtr()(cookie);
+ return CFDateGetAbsoluteTime(CFHTTPCookieGetExpiratonDate(cookie));
+}
+
+static inline RetainPtr<CFStringRef> cookieName(CFHTTPCookieRef cookie)
+{
+ if (CFHTTPCookieCopyNamePtr())
+ return RetainPtr<CFStringRef>(AdoptCF, CFHTTPCookieCopyNamePtr()(cookie));
+ return CFHTTPCookieGetName(cookie);
+}
+
+static inline RetainPtr<CFStringRef> cookiePath(CFHTTPCookieRef cookie)
+{
+ if (CFHTTPCookieCopyPathPtr())
+ return RetainPtr<CFStringRef>(AdoptCF, CFHTTPCookieCopyPathPtr()(cookie));
+ return CFHTTPCookieGetPath(cookie);
+}
+
+static inline RetainPtr<CFStringRef> cookieValue(CFHTTPCookieRef cookie)
+{
+ if (CFHTTPCookieCopyValuePtr())
+ return RetainPtr<CFStringRef>(AdoptCF, CFHTTPCookieCopyValuePtr()(cookie));
+ return CFHTTPCookieGetValue(cookie);
+}
+
static RetainPtr<CFArrayRef> filterCookies(CFArrayRef unfilteredCookies)
{
CFIndex count = CFArrayGetCount(unfilteredCookies);
@@ -55,7 +103,7 @@ static RetainPtr<CFArrayRef> filterCookies(CFArrayRef unfilteredCookies)
// which would be sent as "Cookie: =". We have a workaround in setCookies() to prevent
// that, but we also need to avoid sending cookies that were previously stored, and
// there's no harm to doing this check because such a cookie is never valid.
- if (!CFStringGetLength(CFHTTPCookieGetName(cookie)))
+ if (!CFStringGetLength(cookieName(cookie).get()))
continue;
if (CFHTTPCookieIsHTTPOnly(cookie))
@@ -147,12 +195,12 @@ bool getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
for (CFIndex i = 0; i < count; i++) {
CFHTTPCookieRef cookie = (CFHTTPCookieRef)CFArrayGetValueAtIndex(cookiesCF.get(), i);
- String name = CFHTTPCookieGetName(cookie);
- String value = CFHTTPCookieGetValue(cookie);
- String domain = CFHTTPCookieGetDomain(cookie);
- String path = CFHTTPCookieGetPath(cookie);
+ String name = cookieName(cookie).get();
+ String value = cookieValue(cookie).get();
+ String domain = cookieDomain(cookie).get();
+ String path = cookiePath(cookie).get();
- double expires = (CFDateGetAbsoluteTime(CFHTTPCookieGetExpiratonDate(cookie)) + kCFAbsoluteTimeIntervalSince1970) * 1000;
+ double expires = (cookieExpirationTime(cookie) + kCFAbsoluteTimeIntervalSince1970) * 1000;
bool httpOnly = CFHTTPCookieIsHTTPOnly(cookie);
bool secure = CFHTTPCookieIsSecure(cookie);
@@ -178,8 +226,7 @@ void deleteCookie(const Document*, const KURL& url, const String& name)
CFIndex count = CFArrayGetCount(cookiesCF.get());
for (CFIndex i = 0; i < count; i++) {
CFHTTPCookieRef cookie = (CFHTTPCookieRef)CFArrayGetValueAtIndex(cookiesCF.get(), i);
- String cookieName = CFHTTPCookieGetName(cookie);
- if (cookieName == name) {
+ if (String(cookieName(cookie).get()) == name) {
CFHTTPCookieStorageDeleteCookie(cookieStorage, cookie);
break;
}
diff --git a/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp b/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp
index e17816a..2f2489b 100644
--- a/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp
+++ b/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp
@@ -32,39 +32,39 @@
#include "CookieJar.h"
#include "Cookie.h"
-#include "ChromiumBridge.h"
#include "Document.h"
+#include "PlatformBridge.h"
namespace WebCore {
void setCookies(Document* document, const KURL& url, const String& value)
{
- ChromiumBridge::setCookies(document, url, value);
+ PlatformBridge::setCookies(document, url, value);
}
String cookies(const Document* document, const KURL& url)
{
- return ChromiumBridge::cookies(document, url);
+ return PlatformBridge::cookies(document, url);
}
String cookieRequestHeaderFieldValue(const Document* document, const KURL& url)
{
- return ChromiumBridge::cookieRequestHeaderFieldValue(document, url);
+ return PlatformBridge::cookieRequestHeaderFieldValue(document, url);
}
bool cookiesEnabled(const Document* document)
{
- return ChromiumBridge::cookiesEnabled(document);
+ return PlatformBridge::cookiesEnabled(document);
}
bool getRawCookies(const Document* document, const KURL& url, Vector<Cookie>& rawCookies)
{
- return ChromiumBridge::rawCookies(document, url, rawCookies);
+ return PlatformBridge::rawCookies(document, url, rawCookies);
}
void deleteCookie(const Document* document, const KURL& url, const String& cookieName)
{
- return ChromiumBridge::deleteCookie(document, url, cookieName);
+ return PlatformBridge::deleteCookie(document, url, cookieName);
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/network/chromium/DNSChromium.cpp b/Source/WebCore/platform/network/chromium/DNSChromium.cpp
index 21fcd46..7b9eac5 100644
--- a/Source/WebCore/platform/network/chromium/DNSChromium.cpp
+++ b/Source/WebCore/platform/network/chromium/DNSChromium.cpp
@@ -26,14 +26,14 @@
#include "config.h"
#include "DNS.h"
-#include "ChromiumBridge.h"
+#include "PlatformBridge.h"
#include "ResourceHandle.h"
namespace WebCore {
void prefetchDNS(const String& hostname)
{
- ChromiumBridge::prefetchDNS(hostname);
+ PlatformBridge::prefetchDNS(hostname);
}
void ResourceHandle::prepareForURL(const KURL& url)
diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index ebb6c5f..a7170fe 100644
--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -60,7 +60,8 @@ namespace WebCore {
#define READ_BUFFER_SIZE 8192
-class WebCoreSynchronousLoader : public ResourceHandleClient, public Noncopyable {
+class WebCoreSynchronousLoader : public ResourceHandleClient {
+ WTF_MAKE_NONCOPYABLE(WebCoreSynchronousLoader);
public:
WebCoreSynchronousLoader(ResourceError&, ResourceResponse &, Vector<char>&);
~WebCoreSynchronousLoader();
diff --git a/Source/WebCore/platform/network/win/ResourceHandleWin.cpp b/Source/WebCore/platform/network/win/ResourceHandleWin.cpp
index 38d9cd1..f50540c 100644
--- a/Source/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/Source/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -76,7 +76,8 @@ static String queryHTTPHeader(HINTERNET requestHandle, DWORD infoLevel)
}
-class WebCoreSynchronousLoader : public ResourceHandleClient, public Noncopyable {
+class WebCoreSynchronousLoader : public ResourceHandleClient {
+ WTF_MAKE_NONCOPYABLE(WebCoreSynchronousLoader);
public:
WebCoreSynchronousLoader(ResourceError&, ResourceResponse&, Vector<char>&, const String& userAgent);
~WebCoreSynchronousLoader();