Changeset 70367 in webkit
- Timestamp:
- Oct 22, 2010 4:47:35 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70364 r70367 1 2010-10-20 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam Barth and Darin Adler. 4 5 Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work 6 https://bugs.webkit.org/show_bug.cgi?id=48014 7 <rdar://problem/8202716> 8 9 Add tests and update the skipped list. 10 11 * fast/loader/decide-policy-for-mime-type-async-expected.txt: Added. 12 * fast/loader/decide-policy-for-mime-type-async.html: Added. 13 * platform/gtk/Skipped: 14 * platform/mac-wk2/Skipped: 15 * platform/qt/Skipped: 16 * platform/qt-wk2/Skipped: 17 * platform/win/Skipped: 18 1 19 2010-10-22 Dimitri Glazkov <dglazkov@chromium.org> 2 20 -
trunk/LayoutTests/platform/gtk/Skipped
r70307 r70367 1148 1148 fast/history/window-open.html 1149 1149 fast/html/tab-order.html 1150 fast/loader/decide-policy-for-mime-type-async.html 1150 1151 fast/loader/main-document-url-for-non-http-loads.html 1151 1152 fast/loader/onload-policy-ignore-for-frame.html -
trunk/LayoutTests/platform/mac-wk2/Skipped
r70269 r70367 1525 1525 # WebKitTestRunner needs layoutTestController.setCustomPolicyDelegate 1526 1526 # <https://bugs.webkit.org/show_bug.cgi?id=42546> 1527 fast/loader/decide-policy-for-mime-type-async.html 1527 1528 fast/loader/javascript-url-hierarchical-execution.html 1528 1529 fast/loader/onload-policy-ignore-for-frame.html -
trunk/LayoutTests/platform/qt-wk2/Skipped
r69385 r70367 1473 1473 # WebKitTestRunner needs layoutTestController.setCustomPolicyDelegate 1474 1474 # <https://bugs.webkit.org/show_bug.cgi?id=42546> 1475 fast/loader/decide-policy-for-mime-type-async.html 1475 1476 fast/loader/javascript-url-hierarchical-execution.html 1476 1477 fast/loader/onload-policy-ignore-for-frame.html -
trunk/LayoutTests/platform/qt/Skipped
r70164 r70367 101 101 compositing 102 102 103 fast/loader/decide-policy-for-mime-type-async.html 103 104 fast/loader/subframe-navigate-during-main-frame-load.html 104 105 -
trunk/LayoutTests/platform/win/Skipped
r70147 r70367 1042 1042 # Requires WebP support. 1043 1043 fast/images/webp-image-decoding.html 1044 1045 # Needs ovelroad of setCustomPolicyDelegate 1046 fast/loader/decide-policy-for-mime-type-async.html -
trunk/WebCore/ChangeLog
r70365 r70367 1 2010-10-20 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam Barth and Darin Adler. 4 5 Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work 6 https://bugs.webkit.org/show_bug.cgi?id=48014 7 <rdar://problem/8202716> 8 9 * loader/MainResourceLoader.cpp: 10 (WebCore::MainResourceLoader::continueAfterContentPolicy): 11 Resume loading. 12 13 (WebCore::MainResourceLoader::didReceiveResponse): 14 Defer loading until we hear back from the policy client. 15 1 16 2010-10-22 James Robinson <jamesr@chromium.org> 2 17 -
trunk/WebCore/loader/MainResourceLoader.cpp
r69321 r70367 58 58 , m_loadingMultipartContent(false) 59 59 , m_waitingForContentPolicy(false) 60 , m_deferLoadingCount(0) 60 61 { 61 62 } … … 232 233 KURL url = request().url(); 233 234 const String& mimeType = r.mimeType(); 234 235 236 // This is balanced by a call to setDefersLoading(true) in didReceiveResponse. 237 setDefersLoading(false); 238 235 239 switch (contentPolicy) { 236 240 case PolicyUse: { … … 374 378 RefPtr<MainResourceLoader> protect(this); 375 379 380 // Defer loading while we're waiting for a response. 381 // This is balanced by a setDefersLoading(false) call in continueAfterContentPolicy. 382 setDefersLoading(true); 383 376 384 m_documentLoader->setResponse(r); 377 385 … … 596 604 void MainResourceLoader::setDefersLoading(bool defers) 597 605 { 606 if (defers) { 607 m_deferLoadingCount++; 608 if (m_deferLoadingCount > 1) 609 return; 610 } else { 611 ASSERT(m_deferLoadingCount); 612 m_deferLoadingCount--; 613 if (m_deferLoadingCount > 0) 614 return; 615 } 598 616 ResourceLoader::setDefersLoading(defers); 599 617 -
trunk/WebCore/loader/MainResourceLoader.h
r69226 r70367 109 109 bool m_waitingForContentPolicy; 110 110 double m_timeOfLastDataReceived; 111 unsigned m_deferLoadingCount; 111 112 }; 112 113 -
trunk/WebKitTools/ChangeLog
r70352 r70367 1 2010-10-20 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam Barth and Darin Adler. 4 5 Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work 6 https://bugs.webkit.org/show_bug.cgi?id=48014 7 <rdar://problem/8202716> 8 9 * DumpRenderTree/LayoutTestController.cpp: 10 (setCustomPolicyDelegateCallback): 11 Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument. 12 13 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 14 (LayoutTestController::setCustomPolicyDelegate): 15 Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument. 16 17 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 18 (LayoutTestController::setCustomPolicyDelegate): 19 Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument. 20 21 * DumpRenderTree/mac/PolicyDelegate.h: 22 * DumpRenderTree/mac/PolicyDelegate.mm: 23 (-[PolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]): 24 If _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond is true, call [listener ignore] after one second. 25 26 (-[PolicyDelegate setCallIgnoreInDecidePolicyForMIMETypeAfterOneSecond:]): 27 Update _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond. 28 29 * DumpRenderTree/win/LayoutTestControllerWin.cpp: 30 (LayoutTestController::setCustomPolicyDelegate): 31 Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument. 32 33 * DumpRenderTree/wx/LayoutTestControllerWx.cpp: 34 (LayoutTestController::setCustomPolicyDelegate): 35 Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument. 36 1 37 2010-10-22 Sam Weinig <sam@webkit.org> 2 38 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r70302 r70367 972 972 permissive = JSValueToBoolean(context, arguments[1]); 973 973 974 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 975 controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]), permissive); 974 bool callIgnoreInDecidePolicyForMIMETypeAfterOneSecond = false; 975 if (argumentCount >= 3) 976 callIgnoreInDecidePolicyForMIMETypeAfterOneSecond = JSValueToBoolean(context, arguments[2]); 977 978 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 979 controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]), permissive, callIgnoreInDecidePolicyForMIMETypeAfterOneSecond); 976 980 977 981 return JSValueMakeUndefined(context); -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r70302 r70367 85 85 void setAuthorAndUserStylesEnabled(bool); 86 86 void setCacheModel(int); 87 void setCustomPolicyDelegate(bool setDelegate, bool permissive );87 void setCustomPolicyDelegate(bool setDelegate, bool permissive, bool callIgnoreInDecidePolicyForMIMETypeAfterOneSecond); 88 88 void setDatabaseQuota(unsigned long long quota); 89 89 void setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme); -
trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r70302 r70367 269 269 } 270 270 271 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive )271 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive, bool callIgnoreInDecidePolicyForMIMETypeAfterOneSecond) 272 272 { 273 273 // FIXME: implement -
trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r70302 r70367 320 320 } 321 321 322 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive )322 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive, bool callIgnoreInDecidePolicyForMIMETypeAfterOneSecond) 323 323 { 324 324 if (setDelegate) { 325 [policyDelegate setCallIgnoreInDecidePolicyForMIMETypeAfterOneSecond:callIgnoreInDecidePolicyForMIMETypeAfterOneSecond]; 325 326 [policyDelegate setPermissive:permissive]; 326 327 [[mainFrame webView] setPolicyDelegate:policyDelegate]; -
trunk/WebKitTools/DumpRenderTree/mac/PolicyDelegate.h
r42056 r70367 32 32 33 33 @interface PolicyDelegate : NSObject { 34 BOOL permissiveDelegate; 35 LayoutTestController* controllerToNotifyDone; 34 BOOL _permissiveDelegate; 35 BOOL _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond; 36 LayoutTestController* _controllerToNotifyDone; 36 37 } 37 38 38 39 - (void)setPermissive:(BOOL)permissive; 40 - (void)setCallIgnoreInDecidePolicyForMIMETypeAfterOneSecond:(BOOL)callIgnoreInDecidePolicyForMIMETypeAfterOneSecond; 39 41 - (void)setControllerToNotifyDone:(LayoutTestController*)controller; 40 42 -
trunk/WebKitTools/DumpRenderTree/mac/PolicyDelegate.mm
r46340 r70367 84 84 printf("%s\n", [message UTF8String]); 85 85 86 if ( permissiveDelegate)86 if (_permissiveDelegate) 87 87 [listener use]; 88 88 else 89 89 [listener ignore]; 90 90 91 if ( controllerToNotifyDone) {92 controllerToNotifyDone->notifyDone();93 controllerToNotifyDone = 0;91 if (_controllerToNotifyDone) { 92 _controllerToNotifyDone->notifyDone(); 93 _controllerToNotifyDone = 0; 94 94 } 95 } 96 97 - (void)webView:(WebView *)webView decidePolicyForMIMEType:(NSString *)type 98 request:(NSURLRequest *)request 99 frame:(WebFrame *)frame 100 decisionListener:(id<WebPolicyDecisionListener>)listener 101 { 102 if (!_callIgnoreInDecidePolicyForMIMETypeAfterOneSecond) { 103 [listener use]; 104 return; 105 } 106 107 [(NSObject *)listener performSelector:@selector(ignore) withObject:nil afterDelay:1.0]; 95 108 } 96 109 … … 101 114 } 102 115 116 - (void)setCallIgnoreInDecidePolicyForMIMETypeAfterOneSecond:(BOOL)callIgnoreInDecidePolicyForMIMETypeAfterOneSecond 117 { 118 _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond = callIgnoreInDecidePolicyForMIMETypeAfterOneSecond; 119 } 120 103 121 - (void)setPermissive:(BOOL)permissive 104 122 { 105 permissiveDelegate = permissive;123 _permissiveDelegate = permissive; 106 124 } 107 125 108 126 - (void)setControllerToNotifyDone:(LayoutTestController*)controller 109 127 { 110 controllerToNotifyDone = controller;128 _controllerToNotifyDone = controller; 111 129 } 112 130 -
trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r70302 r70367 369 369 } 370 370 371 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive )371 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive , bool callIgnoreInDecidePolicyForMIMETypeAfterOneSecond) 372 372 { 373 373 COMPtr<IWebView> webView; -
trunk/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
r70302 r70367 108 108 } 109 109 110 void LayoutTestController::setCustomPolicyDelegate(bool, bool )110 void LayoutTestController::setCustomPolicyDelegate(bool, bool, bool) 111 111 { 112 112 // FIXME: implement
Note: See TracChangeset
for help on using the changeset viewer.