Changeset 71097 in webkit
- Timestamp:
- Nov 1, 2010 7:42:26 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/win/ChangeLog
r71041 r71097 1 2010-11-01 Jenn Braithwaite <jennb@chromium.org> 2 3 Reviewed by Adam Roben. 4 5 Windows: Update resource tracking when moving a frame between documents 6 https://bugs.webkit.org/show_bug.cgi?id=48364 7 8 * Interfaces/IWebResourceLoadDelegatePrivate2.idl:Added 9 Added removeIdentifierForRequest. 10 * Interfaces/WebKit.idl: 11 Added IWebResourceLoadDelegatePrivate2.idl. 12 * WebCoreSupport/WebFrameLoaderClient.cpp: 13 (WebFrameLoaderClient::transferLoadingResourceFromPage): 14 1 15 2010-11-01 Brady Eidson <beidson@apple.com> 2 16 -
trunk/WebKit/win/Interfaces/WebKit.idl
r70988 r71097 118 118 #include "IWebResourceLoadDelegate.idl" 119 119 #include "IWebResourceLoadDelegatePrivate.idl" 120 #include "IWebResourceLoadDelegatePrivate2.idl" 120 121 #include "IWebScriptWorld.idl" 121 122 #include "IWebScrollBarDelegatePrivate.idl" -
trunk/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r71032 r71097 748 748 } 749 749 750 void WebFrameLoaderClient::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) 751 { 750 void WebFrameLoaderClient::transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, Page* oldPage) 751 { 752 assignIdentifierToInitialRequest(identifier, loader, request); 753 754 WebView* oldWebView = kit(oldPage); 755 if (!oldWebView) 756 return; 757 758 COMPtr<IWebResourceLoadDelegate> oldResourceLoadDelegate; 759 if (FAILED(oldWebView->resourceLoadDelegate(&oldResourceLoadDelegate))) 760 return; 761 762 COMPtr<IWebResourceLoadDelegatePrivate2> oldResourceLoadDelegatePrivate2(Query, oldResourceLoadDelegate); 763 if (!oldResourceLoadDelegatePrivate2) 764 return; 765 oldResourceLoadDelegatePrivate2->removeIdentifierForRequest(oldWebView, identifier); 752 766 } 753 767 -
trunk/WebKitTools/ChangeLog
r71083 r71097 1 2010-11-01 Jenn Braithwaite <jennb@chromium.org> 2 3 Reviewed by Adam Roben. 4 5 Windows: Update resource tracking when moving a frame between documents 6 https://bugs.webkit.org/show_bug.cgi?id=48364 7 8 * DumpRenderTree/win/DumpRenderTree.cpp: 9 (createWebViewAndOffscreenWindow): 10 (main): 11 Give each WebView its own ResourceLoadDelegate instance in order to 12 make assertions about resource ids on a particular WebView. 13 * DumpRenderTree/win/ResourceLoadDelegate.cpp: 14 (ResourceLoadDelegate::identifierForInitialRequest): 15 Always add id to the map. 16 (ResourceLoadDelegate::removeIdentifierForRequest): 17 Added. 18 (ResourceLoadDelegate::willSendRequest): 19 (ResourceLoadDelegate::didReceiveAuthenticationChallenge): 20 (ResourceLoadDelegate::didReceiveResponse): 21 (ResourceLoadDelegate::didFinishLoadingFromDataSource): 22 (ResourceLoadDelegate::didFailLoadingWithError): 23 (ResourceLoadDelegate::descriptionSuitableForTestResult): 24 Replace static descriptionSuitableForTestResult with static member function to access identifier map. 25 * DumpRenderTree/win/ResourceLoadDelegate.h: 26 (ResourceLoadDelegate::urlMap): 27 Moved within class so that each WebView has its own id map. 28 1 29 2010-11-01 Ojan Vafai <ojan@chromium.org> 2 30 -
trunk/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
r70572 r71097 99 99 COMPtr<UIDelegate> sharedUIDelegate; 100 100 COMPtr<EditingDelegate> sharedEditingDelegate; 101 COMPtr<ResourceLoadDelegate> sharedResourceLoadDelegate;102 101 COMPtr<HistoryDelegate> sharedHistoryDelegate; 103 102 … … 1202 1201 return 0; 1203 1202 1204 if (FAILED(webView->setResourceLoadDelegate(sharedResourceLoadDelegate.get()))) 1203 ResourceLoadDelegate* resourceLoadDelegate = new ResourceLoadDelegate(); 1204 HRESULT result = webView->setResourceLoadDelegate(resourceLoadDelegate); 1205 resourceLoadDelegate->Release(); // The delegate is owned by the WebView, so release our reference to it. 1206 if (FAILED(result)) 1205 1207 return 0; 1206 1208 … … 1286 1288 sharedUIDelegate.adoptRef(new UIDelegate); 1287 1289 sharedEditingDelegate.adoptRef(new EditingDelegate); 1288 sharedResourceLoadDelegate.adoptRef(new ResourceLoadDelegate);1289 1290 sharedHistoryDelegate.adoptRef(new HistoryDelegate); 1290 1291 -
trunk/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
r63681 r71097 36 36 #include <sstream> 37 37 #include <tchar.h> 38 #include <wtf/HashMap.h>39 38 #include <wtf/Vector.h> 40 39 … … 61 60 } 62 61 63 typedef HashMap<unsigned long, wstring> IdentifierMap; 64 65 IdentifierMap& urlMap() 66 { 67 static IdentifierMap urlMap; 68 69 return urlMap; 70 } 71 72 static wstring descriptionSuitableForTestResult(unsigned long identifier) 73 { 74 IdentifierMap::iterator it = urlMap().find(identifier); 75 76 if (it == urlMap().end()) 62 wstring ResourceLoadDelegate::descriptionSuitableForTestResult(unsigned long identifier) const 63 { 64 IdentifierMap::const_iterator it = m_urlMap.find(identifier); 65 66 if (it == m_urlMap.end()) 77 67 return L"<unknown>"; 78 68 … … 80 70 } 81 71 82 static wstringdescriptionSuitableForTestResult(IWebURLRequest* request)72 wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebURLRequest* request) 83 73 { 84 74 if (!request) … … 109 99 } 110 100 111 static wstringdescriptionSuitableForTestResult(IWebURLResponse* response)101 wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebURLResponse* response) 112 102 { 113 103 if (!response) … … 129 119 } 130 120 131 static wstring descriptionSuitableForTestResult(IWebError* error, unsigned long identifier) 121 wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebError* error, unsigned long identifier) const 132 122 { 133 123 wstring result = L"<NSError "; … … 198 188 else if (IsEqualGUID(riid, IID_IWebResourceLoadDelegate)) 199 189 *ppvObject = static_cast<IWebResourceLoadDelegate*>(this); 190 else if (IsEqualGUID(riid, IID_IWebResourceLoadDelegatePrivate2)) 191 *ppvObject = static_cast<IWebResourceLoadDelegatePrivate2*>(this); 200 192 else 201 193 return E_NOINTERFACE; … … 225 217 /* [in] */ unsigned long identifier) 226 218 { 227 if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {219 if (!done) { 228 220 BSTR urlStr; 229 221 if (FAILED(request->URL(&urlStr))) 230 222 return E_FAIL; 231 223 224 ASSERT(!urlMap().contains(identifier)); 232 225 urlMap().set(identifier, wstringFromBSTR(urlStr)); 226 } 227 228 return S_OK; 229 } 230 231 HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::removeIdentifierForRequest( 232 /* [in] */ IWebView* webView, 233 /* [in] */ unsigned long identifier) 234 { 235 if (!done) { 236 ASSERT(urlMap().contains(identifier)); 237 urlMap().remove(identifier); 233 238 } 234 239 … … 352 357 if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { 353 358 printf("%S - didFinishLoading\n", 354 descriptionSuitableForTestResult(identifier).c_str()), 355 urlMap().remove(identifier); 356 } 357 358 return S_OK; 359 descriptionSuitableForTestResult(identifier).c_str()); 360 } 361 362 removeIdentifierForRequest(webView, identifier); 363 364 return S_OK; 359 365 } 360 366 … … 369 375 descriptionSuitableForTestResult(identifier).c_str(), 370 376 descriptionSuitableForTestResult(error, identifier).c_str()); 371 urlMap().remove(identifier); 372 } 373 374 return S_OK; 375 } 377 } 378 379 removeIdentifierForRequest(webView, identifier); 380 381 return S_OK; 382 } -
trunk/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h
r48363 r71097 31 31 32 32 #include <WebKit/WebKit.h> 33 #include <string> 34 #include <wtf/HashMap.h> 33 35 34 class ResourceLoadDelegate : public IWebResourceLoadDelegate {36 class ResourceLoadDelegate : public IWebResourceLoadDelegate, public IWebResourceLoadDelegatePrivate2 { 35 37 public: 36 38 ResourceLoadDelegate(); … … 96 98 /* [in] */ IWebError *error, 97 99 /* [in] */ IWebDataSource *dataSource) { return E_NOTIMPL; } 100 101 // IWebResourceLoadDelegatePrivate2 102 virtual HRESULT STDMETHODCALLTYPE removeIdentifierForRequest( 103 /* [in] */ IWebView *webView, 104 /* [in] */ unsigned long identifier); 98 105 99 protected: 106 private: 107 static std::wstring descriptionSuitableForTestResult(IWebURLRequest*); 108 static std::wstring descriptionSuitableForTestResult(IWebURLResponse*); 109 std::wstring descriptionSuitableForTestResult(unsigned long) const; 110 std::wstring descriptionSuitableForTestResult(IWebError*, unsigned long) const; 111 112 typedef HashMap<unsigned long, std::wstring> IdentifierMap; 113 IdentifierMap& urlMap() { return m_urlMap; } 114 IdentifierMap m_urlMap; 115 100 116 ULONG m_refCount; 101 117 };
Note: See TracChangeset
for help on using the changeset viewer.