Changeset 170222 in webkit
- Timestamp:
- Jun 20, 2014 4:37:38 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r170219 r170222 1 2014-06-20 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] No way to get the main frame’s main resource’s data 4 https://bugs.webkit.org/show_bug.cgi?id=134113 5 6 Reviewed by Sam Weinig. 7 8 * UIProcess/API/Cocoa/WKWebView.mm: 9 (-[WKWebView _getMainResourceDataWithCompletionHandler:]): Added. Calls 10 WebPageProxy::getMainResourceDataOfFrame and invokes the completion handler form the 11 callback. 12 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method. 13 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::getMainResourceDataOfFrame): Made it safe to pass a NULL frame into 16 this function. 17 1 18 2014-06-20 Anders Carlsson <andersca@apple.com> 2 19 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r170195 r170222 1520 1520 } 1521 1521 1522 - (void)_getMainResourceDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler 1523 { 1524 auto handler = adoptNS([completionHandler copy]); 1525 1526 _page->getMainResourceDataOfFrame(_page->mainFrame(), [handler](API::Data* data, WebKit::CallbackBase::Error error) { 1527 void (^completionHandlerBlock)(NSData *, NSError *) = (void (^)(NSData *, NSError *))handler.get(); 1528 if (error != WebKit::CallbackBase::Error::None) { 1529 // FIXME: Pipe a proper error in from the WebPageProxy. 1530 RetainPtr<NSError> error = adoptNS([[NSError alloc] init]); 1531 completionHandlerBlock(nil, error.get()); 1532 } else 1533 completionHandlerBlock(wrapper(*data), nil); 1534 }); 1535 } 1536 1522 1537 - (void)_getWebArchiveDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler 1523 1538 { -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r170195 r170222 152 152 #endif 153 153 154 - (void)_getMainResourceDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler; 154 155 - (void)_getWebArchiveDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler; 155 156 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r170188 r170222 2298 2298 { 2299 2299 RefPtr<DataCallback> callback = DataCallback::create(std::move(callbackFunction)); 2300 if (!isValid() ) {2300 if (!isValid() || !frame) { 2301 2301 callback->invalidate(); 2302 2302 return;
Note: See TracChangeset
for help on using the changeset viewer.