Commit 426fbf99 authored by horo@chromium.org's avatar horo@chromium.org

[ServiceWorker] Introduce isControlledByServiceWorker() in FrameLoaderClient and WebFrameClient

We need to check this in DocumentThreadableLoader not to send CORS preflight requests to the ServiceWorker.

Chromium side is implemented in https://codereview.chromium.org/553603002/.


BUG=411151

Review URL: https://codereview.chromium.org/546263002

git-svn-id: svn://svn.chromium.org/blink/trunk@181549 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 829f24d7
...@@ -244,6 +244,7 @@ public: ...@@ -244,6 +244,7 @@ public:
virtual void didRequestAutocomplete(HTMLFormElement*) OVERRIDE; virtual void didRequestAutocomplete(HTMLFormElement*) OVERRIDE;
virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() OVERRIDE; virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() OVERRIDE;
virtual bool isControlledByServiceWorker() OVERRIDE { return false; }
virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) OVERRIDE; virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) OVERRIDE;
}; };
......
...@@ -221,6 +221,8 @@ namespace blink { ...@@ -221,6 +221,8 @@ namespace blink {
virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() = 0; virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() = 0;
virtual bool isControlledByServiceWorker() = 0;
virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() { return 0; } virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() { return 0; }
virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) = 0; virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) = 0;
......
...@@ -809,6 +809,11 @@ PassOwnPtr<WebServiceWorkerProvider> FrameLoaderClientImpl::createServiceWorkerP ...@@ -809,6 +809,11 @@ PassOwnPtr<WebServiceWorkerProvider> FrameLoaderClientImpl::createServiceWorkerP
return adoptPtr(m_webFrame->client()->createServiceWorkerProvider(m_webFrame)); return adoptPtr(m_webFrame->client()->createServiceWorkerProvider(m_webFrame));
} }
bool FrameLoaderClientImpl::isControlledByServiceWorker()
{
return m_webFrame->client() && m_webFrame->client()->isControlledByServiceWorker();
}
SharedWorkerRepositoryClient* FrameLoaderClientImpl::sharedWorkerRepositoryClient() SharedWorkerRepositoryClient* FrameLoaderClientImpl::sharedWorkerRepositoryClient()
{ {
return m_webFrame->sharedWorkerRepositoryClient(); return m_webFrame->sharedWorkerRepositoryClient();
......
...@@ -158,6 +158,7 @@ public: ...@@ -158,6 +158,7 @@ public:
virtual void dispatchWillInsertBody() OVERRIDE; virtual void dispatchWillInsertBody() OVERRIDE;
virtual PassOwnPtr<WebServiceWorkerProvider> createServiceWorkerProvider() OVERRIDE; virtual PassOwnPtr<WebServiceWorkerProvider> createServiceWorkerProvider() OVERRIDE;
virtual bool isControlledByServiceWorker() OVERRIDE;
virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() OVERRIDE; virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() OVERRIDE;
virtual PassOwnPtr<WebApplicationCacheHost> createApplicationCacheHost(WebApplicationCacheHostClient*) OVERRIDE; virtual PassOwnPtr<WebApplicationCacheHost> createApplicationCacheHost(WebApplicationCacheHostClient*) OVERRIDE;
......
...@@ -566,6 +566,11 @@ public: ...@@ -566,6 +566,11 @@ public:
// Notifies embedder about an accessibility event. // Notifies embedder about an accessibility event.
virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { } virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { }
// ServiceWorker -------------------------------------------------------
// Whether the frame is controlled by the ServiceWorker
virtual bool isControlledByServiceWorker() { return false; }
protected: protected:
virtual ~WebFrameClient() { } virtual ~WebFrameClient() { }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment