Changeset 146845 in webkit
- Timestamp:
- Mar 25, 2013, 8:13:02 PM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r146597 r146845 664 664 }; 665 665 666 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)666 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) 667 667 { 668 668 stopCurrentLoad(); … … 703 703 for (unsigned i = 0; i + 1 < headersLength; i += 2) 704 704 request.addHTTPHeaderField(headers[i], headers[i + 1]); 705 if (needReferer && focusedOrMainFrame() && focusedOrMainFrame()->document()) 706 request.addHTTPHeaderField("Referer", focusedOrMainFrame()->document()->url().string().utf8().data()); 705 707 706 708 if (forceDownload) … … 712 714 } 713 715 714 void WebPage::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial )715 { 716 d->load(url, networkToken, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, isInitial, false );716 void WebPage::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial, bool needReferer, bool forceDownload) 717 { 718 d->load(url, networkToken, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, isInitial, false, needReferer, forceDownload); 717 719 } 718 720 719 721 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) 720 722 { 721 d->load(url, networkToken, method, cachePolicy, data, dataLength, headers, headersLength, false, mustHandleInternally, false, "");723 d->load(url, networkToken, method, cachePolicy, data, dataLength, headers, headersLength, false, mustHandleInternally, false, false, ""); 722 724 } 723 725 … … 730 732 return; 731 733 732 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());734 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()); 733 735 } 734 736 … … 741 743 headers.push_back(list[i].second.c_str()); 742 744 } 743 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());745 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()); 744 746 } 745 747 -
trunk/Source/WebKit/blackberry/Api/WebPage.h
r146269 r146845 94 94 WebPageClient* client() const; 95 95 96 void load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial = false );96 void load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial = false, bool needReferer = false, bool forceDownload = false); 97 97 98 98 void loadExtended(const char* url, const char* networkToken, const char* method, Platform::NetworkRequest::CachePolicy = Platform::NetworkRequest::UseProtocolCachePolicy, const char* data = 0, size_t dataLength = 0, const char* const* headers = 0, size_t headersLength = 0, bool mustHandleInternally = false); -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r146269 r146845 115 115 bool handleWheelEvent(WebCore::PlatformWheelEvent&); 116 116 117 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());117 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()); 118 118 void loadString(const BlackBerry::Platform::String&, const BlackBerry::Platform::String& baseURL, const BlackBerry::Platform::String& mimeType, const BlackBerry::Platform::String& failingURL); 119 119 bool executeJavaScript(const BlackBerry::Platform::String& script, JavaScriptDataType& returnType, BlackBerry::Platform::String& returnValue); -
trunk/Source/WebKit/blackberry/ChangeLog
r146674 r146845 1 2013-03-25 Mary Wu <mary.wu@torchmobile.com.cn> 2 3 [BlackBerry] add needReferer in WebPage load() api 4 https://bugs.webkit.org/show_bug.cgi?id=113167 5 6 Reviewed by Rob Buis. 7 8 PR310175, internally reviewed by Joe Mason. 9 Sometimes when client load request, it need to add referer with current frame like 10 save link/image in option menu, so we add needRef in load() interface in webpage. 11 12 * Api/WebPage.cpp: 13 (BlackBerry::WebKit::WebPagePrivate::load): 14 (BlackBerry::WebKit::WebPage::load): 15 (BlackBerry::WebKit::WebPage::loadExtended): 16 (BlackBerry::WebKit::WebPage::loadFile): 17 (BlackBerry::WebKit::WebPage::download): 18 * Api/WebPage.h: 19 * Api/WebPage_p.h: 20 (WebPagePrivate): 21 1 22 2013-03-22 Nima Ghanavatian <nghanavatian@blackberry.com> 2 23
Note:
See TracChangeset
for help on using the changeset viewer.