Title: [158779] trunk/Source/WebKit2
- Revision
- 158779
- Author
- m...@apple.com
- Date
- 2013-11-06 12:56:52 -0800 (Wed, 06 Nov 2013)
Log Message
[Cocoa] Add -[WKNavigationData response]
https://bugs.webkit.org/show_bug.cgi?id=123918
Reviewed by Sam Weinig.
* Shared/WebNavigationDataStore.h: Added a ResourceResponse data member.
(WebKit::WebNavigationDataStore::encode): Encode the response.
(WebKit::WebNavigationDataStore::decode): Decode the response.
* UIProcess/Cocoa/WKNavigationData.h: Declared new property.
* UIProcess/Cocoa/WKNavigationData.mm:
(-[WKNavigationData response]): Added.
* UIProcess/WebNavigationData.h:
(WebKit::WebNavigationData::response): Added.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::updateGlobalHistory): Set the response in the data store.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (158778 => 158779)
--- trunk/Source/WebKit2/ChangeLog 2013-11-06 20:49:39 UTC (rev 158778)
+++ trunk/Source/WebKit2/ChangeLog 2013-11-06 20:56:52 UTC (rev 158779)
@@ -1,3 +1,21 @@
+2013-11-06 Dan Bernstein <m...@apple.com>
+
+ [Cocoa] Add -[WKNavigationData response]
+ https://bugs.webkit.org/show_bug.cgi?id=123918
+
+ Reviewed by Sam Weinig.
+
+ * Shared/WebNavigationDataStore.h: Added a ResourceResponse data member.
+ (WebKit::WebNavigationDataStore::encode): Encode the response.
+ (WebKit::WebNavigationDataStore::decode): Decode the response.
+ * UIProcess/Cocoa/WKNavigationData.h: Declared new property.
+ * UIProcess/Cocoa/WKNavigationData.mm:
+ (-[WKNavigationData response]): Added.
+ * UIProcess/WebNavigationData.h:
+ (WebKit::WebNavigationData::response): Added.
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::updateGlobalHistory): Set the response in the data store.
+
2013-11-06 Sam Weinig <s...@webkit.org>
Fix the 32-bit build.
Modified: trunk/Source/WebKit2/Shared/WebNavigationDataStore.h (158778 => 158779)
--- trunk/Source/WebKit2/Shared/WebNavigationDataStore.h 2013-11-06 20:49:39 UTC (rev 158778)
+++ trunk/Source/WebKit2/Shared/WebNavigationDataStore.h 2013-11-06 20:56:52 UTC (rev 158779)
@@ -40,6 +40,7 @@
encoder << url;
encoder << title;
encoder << originalRequest;
+ encoder << response;
}
static bool decode(CoreIPC::ArgumentDecoder& decoder, WebNavigationDataStore& store)
@@ -50,6 +51,8 @@
return false;
if (!decoder.decode(store.originalRequest))
return false;
+ if (!decoder.decode(store.response))
+ return false;
return true;
}
@@ -57,6 +60,7 @@
String url;
String title;
WebCore::ResourceRequest originalRequest;
+ WebCore::ResourceResponse response;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WKNavigationData.h (158778 => 158779)
--- trunk/Source/WebKit2/UIProcess/Cocoa/WKNavigationData.h 2013-11-06 20:49:39 UTC (rev 158778)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WKNavigationData.h 2013-11-06 20:56:52 UTC (rev 158779)
@@ -37,6 +37,7 @@
@property (readonly) NSString *title;
@property (readonly) NSURLRequest *originalRequest;
@property (readonly) NSURL *destinationURL;
+@property (readonly) NSURLResponse *response;
@end
Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WKNavigationData.mm (158778 => 158779)
--- trunk/Source/WebKit2/UIProcess/Cocoa/WKNavigationData.mm 2013-11-06 20:49:39 UTC (rev 158778)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WKNavigationData.mm 2013-11-06 20:56:52 UTC (rev 158779)
@@ -29,6 +29,7 @@
#if WK_API_ENABLED
#import <WebCore/ResourceRequest.h>
+#import <WebCore/ResourceResponse.h>
using namespace WebKit;
@@ -58,6 +59,11 @@
return [NSURL URLWithString:reinterpret_cast<WebNavigationData*>(&_data)->url()];
}
+- (NSURLResponse *)response
+{
+ return reinterpret_cast<WebNavigationData*>(&_data)->response().nsURLResponse();
+}
+
#pragma mark WKObject protocol implementation
- (APIObject&)_apiObject
Modified: trunk/Source/WebKit2/UIProcess/WebNavigationData.h (158778 => 158779)
--- trunk/Source/WebKit2/UIProcess/WebNavigationData.h 2013-11-06 20:49:39 UTC (rev 158778)
+++ trunk/Source/WebKit2/UIProcess/WebNavigationData.h 2013-11-06 20:56:52 UTC (rev 158779)
@@ -44,6 +44,7 @@
String title() const { return m_store.title; }
String url() const { return m_store.url; }
const WebCore::ResourceRequest& originalRequest() const { return m_store.originalRequest; }
+ const WebCore::ResourceResponse& response() const { return m_store.response; }
private:
explicit WebNavigationData(const WebNavigationDataStore&);
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (158778 => 158779)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2013-11-06 20:49:39 UTC (rev 158778)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2013-11-06 20:56:52 UTC (rev 158779)
@@ -909,6 +909,7 @@
// FIXME: use direction of title.
data.title = loader->title().string();
data.originalRequest = loader->originalRequestCopy();
+ data.response = loader->response();
WebProcess::shared().parentProcessConnection()->send(Messages::WebProcessProxy::DidNavigateWithNavigationData(webPage->pageID(), data, m_frame->frameID()), 0);
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes