Changeset 157701 in webkit
- Timestamp:
- Oct 20, 2013, 8:43:48 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r157700 r157701 1 2013-10-20 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Loading progress API 4 https://bugs.webkit.org/show_bug.cgi?id=123069 5 6 Reviewed by Sam Weinig. 7 8 * UIProcess/API/mac/WKBrowsingContextController.h: Declared estimatedProgress property. 9 * UIProcess/API/mac/WKBrowsingContextController.mm: 10 (-[WKBrowsingContextController estimatedProgress]): Added. 11 (didStartProgress): Added. Calls new delegate method 12 -browsingContextControllerDidStartProgress:. 13 (didChangeProgress): Added. Calls new delegate method 14 -browsingContextController:estimatedProgressChangedTo:. 15 (didFinishProgress): Added. Calls new delegate method 16 -browsingContextControllerDidFinishProgress:. 17 (setUpPageLoaderClient): Hook up new client functions. 18 * UIProcess/API/mac/WKBrowsingContextLoadDelegate.h: Declared new delegate methods. 19 1 20 2013-10-20 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 21 -
trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h
r157681 r157701 103 103 @property(readonly) NSURL *committedURL; 104 104 105 @property(readonly) double estimatedProgress; 105 106 106 107 #pragma mark Active Document Introspection -
trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
r157681 r157701 271 271 } 272 272 273 - (double)estimatedProgress 274 { 275 return toImpl(self._pageRef)->estimatedProgress(); 276 } 277 273 278 #pragma mark Active Document Introspection 274 279 … … 452 457 } 453 458 459 static void didStartProgress(WKPageRef page, const void* clientInfo) 460 { 461 WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo; 462 if ([browsingContext.loadDelegate respondsToSelector:@selector(browsingContextControllerDidStartProgress:)]) 463 [browsingContext.loadDelegate browsingContextControllerDidStartProgress:browsingContext]; 464 } 465 466 static void didChangeProgress(WKPageRef page, const void* clientInfo) 467 { 468 WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo; 469 if ([browsingContext.loadDelegate respondsToSelector:@selector(browsingContextController:estimatedProgressChangedTo:)]) 470 [browsingContext.loadDelegate browsingContextController:browsingContext estimatedProgressChangedTo:toImpl(page)->estimatedProgress()]; 471 } 472 473 static void didFinishProgress(WKPageRef page, const void* clientInfo) 474 { 475 WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo; 476 if ([browsingContext.loadDelegate respondsToSelector:@selector(browsingContextControllerDidFinishProgress:)]) 477 [browsingContext.loadDelegate browsingContextControllerDidFinishProgress:browsingContext]; 478 } 479 454 480 static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext, WKPageRef pageRef) 455 481 { … … 466 492 loaderClient.didFailLoadWithErrorForFrame = didFailLoadWithErrorForFrame; 467 493 494 loaderClient.didStartProgress = didStartProgress; 495 loaderClient.didChangeProgress = didChangeProgress; 496 loaderClient.didFinishProgress = didFinishProgress; 497 468 498 WKPageSetPageLoaderClient(pageRef, &loaderClient); 469 499 } -
trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextLoadDelegate.h
r155770 r157701 49 49 - (void)browsingContextControllerDidFailLoad:(WKBrowsingContextController *)sender withError:(NSError *)error; 50 50 51 - (void)browsingContextControllerDidStartProgress:(WKBrowsingContextController *)sender; 52 - (void)browsingContextController:(WKBrowsingContextController *)sender estimatedProgressChangedTo:(double)estimatedProgress; 53 - (void)browsingContextControllerDidFinishProgress:(WKBrowsingContextController *)sender; 54 51 55 @end
Note:
See TracChangeset
for help on using the changeset viewer.