| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_WEBSOCKET_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_WEBSOCKET_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_WEBSOCKET_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_WEBSOCKET_HOST_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } // namespace ppapi | 22 } // namespace ppapi |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 class RendererPpapiHost; | 26 class RendererPpapiHost; |
| 27 | 27 |
| 28 class CONTENT_EXPORT PepperWebSocketHost | 28 class CONTENT_EXPORT PepperWebSocketHost |
| 29 : public ppapi::host::ResourceHost, | 29 : public ppapi::host::ResourceHost, |
| 30 public NON_EXPORTED_BASE(::WebKit::WebSocketClient) { | 30 public NON_EXPORTED_BASE(::WebKit::WebSocketClient) { |
| 31 public: | 31 public: |
| 32 explicit PepperWebSocketHost(RendererPpapiHost* host, | 32 PepperWebSocketHost(RendererPpapiHost* host, |
| 33 PP_Instance instance, | 33 PP_Instance instance, |
| 34 PP_Resource resource); | 34 PP_Resource resource); |
| 35 virtual ~PepperWebSocketHost(); | 35 virtual ~PepperWebSocketHost(); |
| 36 | 36 |
| 37 virtual int32_t OnResourceMessageReceived( | 37 virtual int32_t OnResourceMessageReceived( |
| 38 const IPC::Message& msg, | 38 const IPC::Message& msg, |
| 39 ppapi::host::HostMessageContext* context) OVERRIDE; | 39 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 40 | 40 |
| 41 // WebSocketClient implementation. | 41 // WebSocketClient implementation. |
| 42 virtual void didConnect(); | 42 virtual void didConnect(); |
| 43 virtual void didReceiveMessage(const WebKit::WebString& message); | 43 virtual void didReceiveMessage(const WebKit::WebString& message); |
| 44 virtual void didReceiveArrayBuffer(const WebKit::WebArrayBuffer& binaryData); | 44 virtual void didReceiveArrayBuffer(const WebKit::WebArrayBuffer& binaryData); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Keeps the WebKit side WebSocket object. This is used for calling WebKit | 90 // Keeps the WebKit side WebSocket object. This is used for calling WebKit |
| 91 // side functions via WebKit API. | 91 // side functions via WebKit API. |
| 92 scoped_ptr<WebKit::WebSocket> websocket_; | 92 scoped_ptr<WebKit::WebSocket> websocket_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(PepperWebSocketHost); | 94 DISALLOW_COPY_AND_ASSIGN(PepperWebSocketHost); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace content | 97 } // namespace content |
| 98 | 98 |
| 99 #endif // CONTENT_RENDERER_PEPPER_PEPPER_WEBSOCKET_HOST_H_ | 99 #endif // CONTENT_RENDERER_PEPPER_PEPPER_WEBSOCKET_HOST_H_ |
| OLD | NEW |