Changeset 77085 in webkit
- Timestamp:
- Jan 30, 2011 12:30:27 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r77055 r77085 1 2011-01-29 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 Add WKPageCopyPendingAPIRequestURL API 6 https://bugs.webkit.org/show_bug.cgi?id=53383 7 8 This API returns the last URL requested for load via API, if neither that load nor any 9 other load subsequently reaches the provisional state. 10 11 This is useful to be able to track loads initiated via the API 12 13 * UIProcess/API/C/WKPage.cpp: 14 (WKPageCopyPendingAPIRequestURL): Retrieve the pending URL. 15 * UIProcess/API/C/WKPage.h: 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::loadURL): Set pending URL. 18 (WebKit::WebPageProxy::loadURLRequest): ditto 19 (WebKit::WebPageProxy::reload): ditto 20 (WebKit::WebPageProxy::goForward): ditto 21 (WebKit::WebPageProxy::goBack): ditto 22 (WebKit::WebPageProxy::estimatedProgress): Assume the initial 23 progress value when there is a pending URL. 24 (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Clear 25 pending URL; clients should look at the provisional URL now. 26 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Clear 27 pending URL if it doesn't match the policy URL; this means we 28 were interrupted by another load. 29 * UIProcess/WebPageProxy.h: 30 (WebKit::WebPageProxy::pendingAPIRequestURL): Helper function. 31 (WebKit::WebPageProxy::clearPendingAPIRequestURL): ditto 32 (WebKit::WebPageProxy::setPendingAPIRequestURL): ditto 33 1 34 2011-01-28 Jon Honeycutt <jhoneycutt@apple.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r76916 r77085 436 436 toImpl(pageRef)->forceRepaint(VoidCallback::create(context, callback)); 437 437 } 438 439 WK_EXPORT WKURLRef WKPageCopyPendingAPIRequestURL(WKPageRef pageRef) 440 { 441 if (toImpl(pageRef)->pendingAPIRequestURL().isNull()) 442 return 0; 443 return toCopiedURLAPI(toImpl(pageRef)->pendingAPIRequestURL()); 444 } -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r76452 r77085 345 345 WK_EXPORT void WKPageForceRepaint(WKPageRef page, void* context, WKPageForceRepaintFunction function); 346 346 347 WK_EXPORT WKURLRef WKPageCopyPendingAPIRequestURL(WKPageRef page); 348 347 349 #ifdef __cplusplus 348 350 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r77054 r77085 321 321 void WebPageProxy::loadURL(const String& url) 322 322 { 323 setPendingAPIRequestURL(url); 324 323 325 if (!isValid()) 324 326 reattachToWebProcess(); … … 331 333 void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest) 332 334 { 335 setPendingAPIRequestURL(urlRequest->resourceRequest().url()); 336 333 337 if (!isValid()) 334 338 reattachToWebProcess(); … … 374 378 void WebPageProxy::reload(bool reloadFromOrigin) 375 379 { 380 setPendingAPIRequestURL(m_backForwardList->currentItem()->url()); 381 376 382 if (!isValid()) { 377 383 reattachToWebProcessWithItem(m_backForwardList->currentItem()); … … 384 390 void WebPageProxy::goForward() 385 391 { 392 if (isValid() && !canGoForward()) 393 return; 394 395 setPendingAPIRequestURL(m_backForwardList->forwardItem()->url()); 396 386 397 if (!isValid()) { 387 398 reattachToWebProcessWithItem(m_backForwardList->forwardItem()); … … 389 400 } 390 401 391 if (!canGoForward())392 return;393 394 402 process()->send(Messages::WebPage::GoForward(m_backForwardList->forwardItem()->itemID()), m_pageID); 395 403 } … … 402 410 void WebPageProxy::goBack() 403 411 { 412 if (isValid() && !canGoBack()) 413 return; 414 415 setPendingAPIRequestURL(m_backForwardList->backItem()->url()); 416 404 417 if (!isValid()) { 405 418 reattachToWebProcessWithItem(m_backForwardList->backItem()); 406 419 return; 407 420 } 408 409 if (!canGoBack())410 return;411 421 412 422 process()->send(Messages::WebPage::GoBack(m_backForwardList->backItem()->itemID()), m_pageID); … … 1181 1191 static const double initialProgressValue = 0.1; 1182 1192 1193 double WebPageProxy::estimatedProgress() const 1194 { 1195 if (!pendingAPIRequestURL().isNull()) 1196 return initialProgressValue; 1197 return m_estimatedProgress; 1198 } 1199 1183 1200 void WebPageProxy::didStartProgress() 1184 1201 { … … 1204 1221 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, bool loadingSubstituteDataForUnreachableURL, CoreIPC::ArgumentDecoder* arguments) 1205 1222 { 1223 clearPendingAPIRequestURL(); 1224 1206 1225 RefPtr<APIObject> userData; 1207 1226 WebContextUserMessageDecoder messageDecoder(userData, context()); … … 1430 1449 void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const String& url, uint64_t listenerID) 1431 1450 { 1451 if (url != pendingAPIRequestURL()) 1452 clearPendingAPIRequestURL(); 1453 1432 1454 WebFrameProxy* frame = process()->webFrame(frameID); 1433 1455 MESSAGE_CHECK(frame); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r77054 r77085 241 241 String customTextEncodingName() const { return m_customTextEncodingName; } 242 242 243 double estimatedProgress() const { return m_estimatedProgress; }243 double estimatedProgress() const; 244 244 245 245 void terminateProcess(); … … 372 372 void drawPagesToPDF(WebFrameProxy*, uint32_t first, uint32_t count, PassRefPtr<DataCallback>); 373 373 #endif 374 375 const String& pendingAPIRequestURL() const { return m_pendingAPIRequestURL; } 374 376 375 377 private: … … 545 547 static String standardUserAgent(const String& applicationName = String()); 546 548 549 void clearPendingAPIRequestURL() { m_pendingAPIRequestURL = String(); } 550 void setPendingAPIRequestURL(const String& pendingAPIRequestURL) { m_pendingAPIRequestURL = pendingAPIRequestURL; } 551 547 552 PageClient* m_pageClient; 548 553 WebLoaderClient m_loaderClient; … … 644 649 bool m_mainFrameHasCustomRepresentation; 645 650 WebCore::DragOperation m_currentDragOperation; 651 652 String m_pendingAPIRequestURL; 646 653 }; 647 654
Note: See TracChangeset
for help on using the changeset viewer.