namespace WebCore {
+#if PLATFORM(ANDROID)
+class FrameLoaderClient;
+class MainResourceLoader;
+#endif
class ResourceError;
class ResourceRequest;
virtual ResourceError blockedError(const ResourceRequest&) const = 0;
#endif
+#if PLATFORM(ANDROID)
+ virtual MainResourceLoader* mainResourceLoader() const = 0;
+ virtual FrameLoaderClient* frameLoaderClient() const = 0;
+#endif
+
protected:
NetworkingContext() { }
};
namespace WebCore {
-void setCookies(Document*, const KURL& url, const String& value)
+void setCookies(Document* document, const KURL& url, const String& value)
{
- PlatformBridge::setCookies(url, value);
+ PlatformBridge::setCookies(document, url, value);
}
-String cookies(const Document*, const KURL& url)
+String cookies(const Document* document, const KURL& url)
{
- return PlatformBridge::cookies(url);
+ return PlatformBridge::cookies(document, url);
}
-String cookieRequestHeaderFieldValue(const Document*, const KURL& url)
+String cookieRequestHeaderFieldValue(const Document* document, const KURL& url)
{
// FIXME: include HttpOnly cookie.
- return PlatformBridge::cookies(url);
+ return PlatformBridge::cookies(document, url);
}
-bool cookiesEnabled(const Document*)
+bool cookiesEnabled(const Document* document)
{
- return PlatformBridge::cookiesEnabled();
+ return PlatformBridge::cookiesEnabled(document);
}
}
--- /dev/null
+/*
+ * Copyright 2010, The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ProxyServer.h"
+
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+Vector<ProxyServer> proxyServersForURL(const KURL&, const NetworkingContext*)
+{
+ notImplemented();
+ return Vector<ProxyServer>();
+}
+
+}
*/
#include "config.h"
-
#include "ResourceHandle.h"
#include "CachedResourceLoader.h"
#include "ResourceHandleClient.h"
#include "ResourceHandleInternal.h"
#include "ResourceLoaderAndroid.h"
+#include "Settings.h"
#include <wtf/text/CString.h>
namespace WebCore {
{
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
- DocumentLoader* documentLoader = frame->loader()->activeDocumentLoader();
- MainResourceLoader* mainLoader = documentLoader->mainResourceLoader();
- bool isMainResource = mainLoader && (mainLoader->handle() == this);
-
- PassRefPtr<ResourceLoaderAndroid> loader = ResourceLoaderAndroid::start(this, d->m_request, frame->loader()->client(), isMainResource, false);
+ MainResourceLoader* mainLoader = context->mainResourceLoader();
+ bool isMainResource = static_cast<void*>(mainLoader) == static_cast<void*>(client());
+ RefPtr<ResourceLoaderAndroid> loader = ResourceLoaderAndroid::start(this, d->m_firstRequest, context->frameLoaderClient(), isMainResource, false);
if (loader) {
- d->m_loader = loader;
+ d->m_loader = loader.release();
return true;
}
return ResourceLoaderAndroid::willLoadFromCache(request.url(), formData ? formData->identifier() : 0);
}
-bool ResourceHandle::loadsBlocked()
+bool ResourceHandle::loadsBlocked()
{
// FIXME, need to check whether connection pipe is blocked.
// return false for now
- return false;
+ return false;
}
// Class to handle synchronized loading of resources.
WTF::Vector<char>* m_data;
};
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request,
- StoredCredentials /*storedCredentials*/,
- ResourceError& error, ResourceResponse& response, WTF::Vector<char>& data,
- Frame* frame)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request,
+ StoredCredentials, ResourceError& error, ResourceResponse& response, WTF::Vector<char>& data)
{
SyncLoader s(error, response, data);
- RefPtr<ResourceHandle> h = adoptRef(new ResourceHandle(request, &s, false, false, false));
+ RefPtr<ResourceHandle> h = adoptRef(new ResourceHandle(request, &s, false, false));
// This blocks until the load is finished.
- ResourceLoaderAndroid::start(h.get(), request, frame->loader()->client(), false, true);
+ // Use the request owned by the ResourceHandle. This has had the username
+ // and password (if present) stripped from the URL in
+ // ResourceHandleInternal::ResourceHandleInternal(). This matches the
+ // behaviour in the asynchronous case.
+ ResourceLoaderAndroid::start(h.get(), request, context->frameLoaderClient(), false, true);
}
} // namespace WebCore
unsigned initializeMaximumHTTPConnectionCountPerHost()
{
+#if USE(CHROME_NETWORK_STACK)
+ // The chromium network stack already handles limiting the number of
+ // parallel requests per host, so there's no need to do it here. Therefore,
+ // this is set to a high value that should never be hit in practice.
+ return 10000;
+#else
// This is used by the loader to control the number of parallel load
// requests. Our java framework has 4 threads that can each pipeline up to
// 5 requests. Use 20 as a maximum number.
return 20;
+#endif
}
} // namespace WebCore