Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (146844 => 146845)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-03-26 03:11:09 UTC (rev 146844)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-03-26 03:13:02 UTC (rev 146845)
@@ -663,7 +663,7 @@
}
};
-void WebPagePrivate::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, const BlackBerry::Platform::String& method, Platform::NetworkRequest::CachePolicy cachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool isInitial, bool mustHandleInternally, bool forceDownload, const BlackBerry::Platform::String& overrideContentType, const BlackBerry::Platform::String& suggestedSaveName)
+void WebPagePrivate::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, const BlackBerry::Platform::String& method, Platform::NetworkRequest::CachePolicy cachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool isInitial, bool mustHandleInternally, bool needReferer, bool forceDownload, const BlackBerry::Platform::String& overrideContentType, const BlackBerry::Platform::String& suggestedSaveName)
{
stopCurrentLoad();
DeferredTaskLoadManualScript::finishOrCancel(this);
@@ -702,6 +702,8 @@
for (unsigned i = 0; i + 1 < headersLength; i += 2)
request.addHTTPHeaderField(headers[i], headers[i + 1]);
+ if (needReferer && focusedOrMainFrame() && focusedOrMainFrame()->document())
+ request.addHTTPHeaderField("Referer", focusedOrMainFrame()->document()->url().string().utf8().data());
if (forceDownload)
request.setForceDownload(true);
@@ -711,14 +713,14 @@
m_mainFrame->loader()->load(FrameLoadRequest(m_mainFrame, request));
}
-void WebPage::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial)
+void WebPage::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial, bool needReferer, bool forceDownload)
{
- d->load(url, networkToken, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, isInitial, false);
+ d->load(url, networkToken, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, isInitial, false, needReferer, forceDownload);
}
void WebPage::loadExtended(const char* url, const char* networkToken, const char* method, Platform::NetworkRequest::CachePolicy cachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool mustHandleInternally)
{
- d->load(url, networkToken, method, cachePolicy, data, dataLength, headers, headersLength, false, mustHandleInternally, false, "");
+ d->load(url, networkToken, method, cachePolicy, data, dataLength, headers, headersLength, false, mustHandleInternally, false, false, "");
}
void WebPage::loadFile(const BlackBerry::Platform::String& path, const BlackBerry::Platform::String& overrideContentType)
@@ -729,7 +731,7 @@
else if (!fileUrl.startsWith("file:///"))
return;
- d->load(fileUrl, BlackBerry::Platform::String::emptyString(), BlackBerry::Platform::String("GET", 3), Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, false, false, false, overrideContentType.c_str());
+ d->load(fileUrl, BlackBerry::Platform::String::emptyString(), BlackBerry::Platform::String("GET", 3), Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, false, false, false, false, overrideContentType.c_str());
}
void WebPage::download(const Platform::NetworkRequest& request)
@@ -740,7 +742,7 @@
headers.push_back(list[i].first.c_str());
headers.push_back(list[i].second.c_str());
}
- d->load(request.getUrlRef(), BlackBerry::Platform::String::emptyString(), "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, headers.empty() ? 0 : &headers[0], headers.size(), false, false, true, "", request.getSuggestedSaveName().c_str());
+ d->load(request.getUrlRef(), BlackBerry::Platform::String::emptyString(), "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, headers.empty() ? 0 : &headers[0], headers.size(), false, false, false, true, "", request.getSuggestedSaveName().c_str());
}
void WebPagePrivate::loadString(const BlackBerry::Platform::String& string, const BlackBerry::Platform::String& baseURL, const BlackBerry::Platform::String& contentType, const BlackBerry::Platform::String& failingURL)
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (146844 => 146845)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2013-03-26 03:11:09 UTC (rev 146844)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2013-03-26 03:13:02 UTC (rev 146845)
@@ -114,7 +114,7 @@
bool handleMouseEvent(WebCore::PlatformMouseEvent&);
bool handleWheelEvent(WebCore::PlatformWheelEvent&);
- void load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, const BlackBerry::Platform::String& method, Platform::NetworkRequest::CachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool isInitial, bool mustHandleInternally = false, bool forceDownload = false, const BlackBerry::Platform::String& overrideContentType = BlackBerry::Platform::String::emptyString(), const BlackBerry::Platform::String& suggestedSaveName = BlackBerry::Platform::String::emptyString());
+ void load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, const BlackBerry::Platform::String& method, Platform::NetworkRequest::CachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool isInitial, bool mustHandleInternally = false, bool needReferer = false, bool forceDownload = false, const BlackBerry::Platform::String& overrideContentType = BlackBerry::Platform::String::emptyString(), const BlackBerry::Platform::String& suggestedSaveName = BlackBerry::Platform::String::emptyString());
void loadString(const BlackBerry::Platform::String&, const BlackBerry::Platform::String& baseURL, const BlackBerry::Platform::String& mimeType, const BlackBerry::Platform::String& failingURL);
bool executeJavaScript(const BlackBerry::Platform::String& script, _javascript_DataType& returnType, BlackBerry::Platform::String& returnValue);
bool executeJavaScriptInIsolatedWorld(const WebCore::ScriptSourceCode&, _javascript_DataType& returnType, BlackBerry::Platform::String& returnValue);