| 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 WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 12 #include "ppapi/shared_impl/resource.h" | 13 #include "ppapi/shared_impl/resource.h" |
| 13 #include "ppapi/shared_impl/tracked_callback.h" | 14 #include "ppapi/shared_impl/tracked_callback.h" |
| 14 #include "ppapi/thunk/ppb_websocket_api.h" | 15 #include "ppapi/thunk/ppb_websocket_api.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSocket.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSocket.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSocketClient.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSocketClient.h" |
| 17 | 18 |
| 18 namespace ppapi { | 19 namespace ppapi { |
| 19 class StringVar; | 20 class StringVar; |
| 20 class Var; | 21 class Var; |
| 21 } // namespace ppapi | 22 } // namespace ppapi |
| 22 | 23 |
| 23 namespace webkit { | 24 namespace webkit { |
| 24 namespace ppapi { | 25 namespace ppapi { |
| 25 | 26 |
| 26 // All implementation is in this class for now. We should move some common | 27 // All implementation is in this class for now. We should move some common |
| 27 // implementation to shared_impl when we implement proxy interfaces. | 28 // implementation to shared_impl when we implement proxy interfaces. |
| 28 class PPB_WebSocket_Impl : public ::ppapi::Resource, | 29 class PPB_WebSocket_Impl : public ::ppapi::Resource, |
| 29 public ::ppapi::thunk::PPB_WebSocket_API, | 30 public ::ppapi::thunk::PPB_WebSocket_API, |
| 30 public ::WebKit::WebSocketClient { | 31 public ::WebKit::WebSocketClient, |
| 32 public ::base::SupportsWeakPtr<PPB_WebSocket_Impl> { |
| 31 public: | 33 public: |
| 32 explicit PPB_WebSocket_Impl(PP_Instance instance); | 34 explicit PPB_WebSocket_Impl(PP_Instance instance); |
| 33 virtual ~PPB_WebSocket_Impl(); | 35 virtual ~PPB_WebSocket_Impl(); |
| 34 | 36 |
| 35 static PP_Resource Create(PP_Instance instance); | 37 static PP_Resource Create(PP_Instance instance); |
| 36 | 38 |
| 37 // Resource overrides. | 39 // Resource overrides. |
| 38 // Returns the pointer to the thunk::PPB_WebSocket_API if it's supported. | 40 // Returns the pointer to the thunk::PPB_WebSocket_API if it's supported. |
| 39 virtual ::ppapi::thunk::PPB_WebSocket_API* AsPPB_WebSocket_API() OVERRIDE; | 41 virtual ::ppapi::thunk::PPB_WebSocket_API* AsPPB_WebSocket_API() OVERRIDE; |
| 40 | 42 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // specification. The calculated value can be read via GetBufferedAmount(). | 148 // specification. The calculated value can be read via GetBufferedAmount(). |
| 147 uint64_t buffered_amount_after_close_; | 149 uint64_t buffered_amount_after_close_; |
| 148 | 150 |
| 149 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl); | 151 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl); |
| 150 }; | 152 }; |
| 151 | 153 |
| 152 } // namespace ppapi | 154 } // namespace ppapi |
| 153 } // namespace webkit | 155 } // namespace webkit |
| 154 | 156 |
| 155 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ | 157 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ |
| OLD | NEW |