OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebWorkerFetchContext_h |
| 6 #define WebWorkerFetchContext_h |
| 7 |
| 8 namespace base { |
| 9 class SingleThreadTaskRunner; |
| 10 } // namespace base |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class WebURL; |
| 15 class WebURLLoader; |
| 16 class WebURLRequest; |
| 17 |
| 18 class WebWorkerFetchContext { |
| 19 public: |
| 20 virtual ~WebWorkerFetchContext() {} |
| 21 virtual WebURLLoader* createURLLoader() = 0; |
| 22 virtual bool IsControlledByServiceWorker() const { return false; } |
| 23 virtual int64_t serviceWorkerID() const { return -1; } |
| 24 virtual void willSendRequest(WebURLRequest&) {} |
| 25 virtual void didRunContentWithCertificateErrors(const WebURL& url) {} |
| 26 virtual void didDisplayContentWithCertificateErrors(const WebURL& url) {} |
| 27 }; |
| 28 |
| 29 class WebWorkerFetchContextInfo { |
| 30 public: |
| 31 virtual ~WebWorkerFetchContextInfo() {} |
| 32 virtual std::unique_ptr<WebWorkerFetchContext> CreateContext( |
| 33 base::SingleThreadTaskRunner*) = 0; |
| 34 virtual void setAppCacheHostID(int) {} |
| 35 virtual void setParentFrameID(int) {} |
| 36 virtual void setServiceWorkerProviderID(int) {} |
| 37 virtual void setIsSecureContext(bool) {} |
| 38 virtual void setIsControlledByServiceWorker(bool) {} |
| 39 // only for main thread |
| 40 virtual void willSendRequest(WebURLRequest&) {} |
| 41 }; |
| 42 |
| 43 } // namespace blink |
| 44 |
| 45 #endif // WebWorkerFetchContext_h |
OLD | NEW |