Changeset 58380 in webkit
- Timestamp:
- Apr 27, 2010 10:40:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r58377 r58380 1 2010-04-27 Michael Nordman <michaeln@google.com> 2 3 Reviewed by Dmitry Titov. 4 5 [Chromium] Add two things to the webkit API to support appcaches in workers. 6 1) WebURLRequest TargetTypes for worker and shared worker main resources. 7 2) Factory method on class WebCommonWorkerClient to 8 createApplicationCacheHost() for the associated worker. 9 10 https://bugs.webkit.org/show_bug.cgi?id=38147 11 12 * public/WebCommonWorkerClient.h: add the factory method 13 * public/WebURLRequest.h: add the TargetTypes 14 * src/WebWorkerBase.cpp: call the embedder's factory when needed 15 (WebKit::WebWorkerBase::didCreateDataSource) 16 (WebKit::WebWorkerBase::createApplicationCacheHost) 17 * src/WebWorkerBase.h: ditto 18 * src/WebWorkerClientImpl.h: add a stub impl of the factory method 19 (WebKit::WebWorkerClientImpl::createApplicationCacheHost): 20 1 21 2010-04-27 Kent Tamura <tkent@chromium.org> 2 22 -
trunk/WebKit/chromium/public/WebCommonWorkerClient.h
r57210 r58380 34 34 namespace WebKit { 35 35 36 class WebApplicationCacheHost; 37 class WebApplicationCacheHostClient; 36 38 class WebNotificationPresenter; 37 39 class WebString; … … 75 77 virtual WebWorker* createWorker(WebWorkerClient* client) = 0; 76 78 79 // Called on the main webkit thread in the worker process during initialization. 80 virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) = 0; 81 77 82 protected: 78 83 ~WebCommonWorkerClient() { } -
trunk/WebKit/chromium/public/WebURLRequest.h
r51967 r58380 68 68 TargetIsImage = 6, 69 69 TargetIsObject = 7, 70 TargetIsMedia = 8 70 TargetIsMedia = 8, 71 TargetIsWorker = 9, 72 TargetIsSharedWorker = 10 71 73 }; 72 74 -
trunk/WebKit/chromium/src/WebWorkerBase.cpp
r57210 r58380 52 52 #if ENABLE(WORKERS) 53 53 54 // Dummy WebViewDelegate - we only need it in Worker process to load a55 // 'shadow page' which will initialize WebCore loader.56 class WorkerWebFrameClient : public WebFrameClient {57 public:58 // Tell the loader to load the data into the 'shadow page' synchronously,59 // so we can grab the resulting Document right after load.60 virtual void didCreateDataSource(WebFrame* frame, WebDataSource* ds)61 {62 static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false);63 }64 65 // Lazy allocate and leak this instance.66 static WorkerWebFrameClient* sharedInstance()67 {68 static WorkerWebFrameClient client;69 return &client;70 }71 72 private:73 WorkerWebFrameClient()74 {75 }76 };77 78 54 // This function is called on the main thread to force to initialize some static 79 55 // values used in WebKit before any worker thread is started. This is because in … … 104 80 { 105 81 ASSERT(m_webView); 82 WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); 83 if (webFrame) 84 webFrame->setClient(0); 106 85 m_webView->close(); 107 86 } … … 123 102 ASSERT(!m_webView); 124 103 m_webView = WebView::create(0); 125 m_webView->initializeMainFrame( WorkerWebFrameClient::sharedInstance());104 m_webView->initializeMainFrame(this); 126 105 127 106 WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); … … 152 131 } 153 132 133 void WebWorkerBase::didCreateDataSource(WebFrame*, WebDataSource* ds) 134 { 135 // Tell the loader to load the data into the 'shadow page' synchronously, 136 // so we can grab the resulting Document right after load. 137 static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false); 138 } 139 140 WebApplicationCacheHost* WebWorkerBase::createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient* appcacheHostClient) 141 { 142 if (commonClient()) 143 return commonClient()->createApplicationCacheHost(appcacheHostClient); 144 return 0; 145 } 146 154 147 // WorkerObjectProxy ----------------------------------------------------------- 155 148 -
trunk/WebKit/chromium/src/WebWorkerBase.h
r57210 r58380 35 35 36 36 #include "ScriptExecutionContext.h" 37 #include "WebFrameClient.h" 37 38 #include "WorkerLoaderProxy.h" 38 39 #include "WorkerObjectProxy.h" … … 45 46 46 47 namespace WebKit { 48 class WebApplicationCacheHost; 49 class WebApplicationCacheHostClient; 47 50 class WebCommonWorkerClient; 48 51 class WebSecurityOrigin; … … 57 60 // WorkerObjectProxy and WorkerLoaderProxy interfaces. 58 61 class WebWorkerBase : public WebCore::WorkerObjectProxy 59 , public WebCore::WorkerLoaderProxy { 62 , public WebCore::WorkerLoaderProxy 63 , public WebFrameClient { 60 64 public: 61 65 WebWorkerBase(); … … 80 84 virtual void postTaskForModeToWorkerContext( 81 85 PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const WebCore::String& mode); 86 87 // WebFrameClient methods to support resource loading thru the 'shadow page'. 88 virtual void didCreateDataSource(WebFrame*, WebDataSource*); 89 virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*); 82 90 83 91 // Executes the given task on the main thread. -
trunk/WebKit/chromium/src/WebWorkerClientImpl.h
r57210 r58380 95 95 return 0; 96 96 } 97 virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) { return 0; } 97 98 98 99 private: -
trunk/WebKitTools/ChangeLog
r58376 r58380 1 2010-04-27 Michael Nordman <michaeln@google.com> 2 3 Reviewed by Dmitry Titov. 4 5 [Chromium] Add two things to the webkit API to support appcaches in workers. 6 1) WebURLRequest TargetTypes for worker and shared worker main resources. 7 2) Factory method on class WebCommonWorkerClient to 8 createApplicationCacheHost() for the associated worker. 9 10 https://bugs.webkit.org/show_bug.cgi?id=38147 11 12 * DumpRenderTree/chromium/TestWebWorker.h add a stub impl of the factory method 13 (TestWebWorker::createApplicationCacheHost): 14 1 15 2010-04-27 Adam Barth <abarth@webkit.org> 2 16 -
trunk/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h
r57648 r58380 80 80 virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient*) { return 0; } 81 81 virtual WebKit::WebNotificationPresenter* notificationPresenter() { return 0; } 82 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(WebKit::WebApplicationCacheHostClient*) { return 0; } 82 83 83 84 private:
Note: See TracChangeset
for help on using the changeset viewer.