OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebServiceWorkerProviderClient_h | 31 #ifndef WebSocketHandshakeRequestInfo_h |
32 #define WebServiceWorkerProviderClient_h | 32 #define WebSocketHandshakeRequestInfo_h |
33 | 33 |
34 #include "public/platform/WebCommon.h" | 34 #include "public/platform/WebCommon.h" |
35 #include "public/platform/WebMessagePortChannel.h" | 35 #include "public/platform/WebNonCopyable.h" |
36 #include "public/platform/modules/serviceworker/WebServiceWorker.h" | 36 #include "public/platform/WebPrivatePtr.h" |
37 | |
38 #include <memory> | |
39 | 37 |
40 namespace blink { | 38 namespace blink { |
41 | 39 |
42 class WebServiceWorker; | |
43 class WebString; | 40 class WebString; |
| 41 class WebSocketHandshakeRequest; |
| 42 class WebURL; |
44 | 43 |
45 // This class is the interface for embedders to talk to | 44 class WebSocketHandshakeRequestInfo : public WebNonCopyable { |
46 // ServiceWorkerContainer. | |
47 class BLINK_PLATFORM_EXPORT WebServiceWorkerProviderClient { | |
48 public: | 45 public: |
49 virtual ~WebServiceWorkerProviderClient() { } | 46 BLINK_PLATFORM_EXPORT WebSocketHandshakeRequestInfo(); |
| 47 BLINK_PLATFORM_EXPORT ~WebSocketHandshakeRequestInfo(); |
50 | 48 |
51 virtual void setController(std::unique_ptr<WebServiceWorker::Handle>, bool s
houldNotifyControllerChange) = 0; | 49 BLINK_PLATFORM_EXPORT void setURL(const WebURL&); |
| 50 BLINK_PLATFORM_EXPORT void addHeaderField(const WebString& name, const WebSt
ring& value); |
| 51 BLINK_PLATFORM_EXPORT void setHeadersText(const WebString&); |
52 | 52 |
53 virtual void dispatchMessageEvent(std::unique_ptr<WebServiceWorker::Handle>,
const WebString& message, const WebMessagePortChannelArray& channels) = 0; | 53 #if INSIDE_BLINK |
| 54 BLINK_PLATFORM_EXPORT const WebSocketHandshakeRequest& toCoreRequest() const
{ return *m_private.get(); } |
| 55 #endif // INSIDE_BLINK |
| 56 |
| 57 private: |
| 58 WebPrivatePtr<WebSocketHandshakeRequest> m_private; |
54 }; | 59 }; |
55 | 60 |
56 } // namespace blink | 61 } // namespace blink |
57 | 62 |
58 #endif // WebServiceWorkerProviderClient_h | 63 #endif // WebSocketHandshakeRequestInfo_h |
OLD | NEW |