Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: webkit/plugins/ppapi/ppb_websocket_impl.h

Issue 8748002: WebSocket Pepper API: GetBufferedAmount() implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use namespace Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_websocket.cc ('k') | webkit/plugins/ppapi/ppb_websocket_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 virtual PP_WebSocketReadyState_Dev GetReadyState() OVERRIDE; 59 virtual PP_WebSocketReadyState_Dev GetReadyState() OVERRIDE;
60 virtual PP_Var GetURL() OVERRIDE; 60 virtual PP_Var GetURL() OVERRIDE;
61 61
62 // WebSocketClient implementation. 62 // WebSocketClient implementation.
63 virtual void didConnect() OVERRIDE; 63 virtual void didConnect() OVERRIDE;
64 virtual void didReceiveMessage(const WebKit::WebString& message) OVERRIDE; 64 virtual void didReceiveMessage(const WebKit::WebString& message) OVERRIDE;
65 virtual void didReceiveBinaryData( 65 virtual void didReceiveBinaryData(
66 const WebKit::WebData& binaryData) OVERRIDE; 66 const WebKit::WebData& binaryData) OVERRIDE;
67 virtual void didReceiveMessageError() OVERRIDE; 67 virtual void didReceiveMessageError() OVERRIDE;
68 // TODO(toyoshim): Add OVERRIDE after landing WebKit side change. 68 // TODO(toyoshim): Add OVERRIDE after landing WebKit side change.
69 virtual void didUpdateBufferedAmount(unsigned long bufferedAmount); 69 virtual void didUpdateBufferedAmount(unsigned long buffered_amount);
70 virtual void didStartClosingHandshake() OVERRIDE; 70 virtual void didStartClosingHandshake() OVERRIDE;
71 virtual void didClose(unsigned long bufferedAmount, 71 virtual void didClose(unsigned long buffered_amount,
72 ClosingHandshakeCompletionStatus status, 72 ClosingHandshakeCompletionStatus status,
73 unsigned short code, 73 unsigned short code,
74 const WebKit::WebString& reason) OVERRIDE; 74 const WebKit::WebString& reason) OVERRIDE;
75 private: 75 private:
76 int32_t DoReceive(); 76 int32_t DoReceive();
77 77
78 scoped_ptr<WebKit::WebSocket> websocket_; 78 scoped_ptr<WebKit::WebSocket> websocket_;
79 PP_WebSocketReadyState_Dev state_; 79 PP_WebSocketReadyState_Dev state_;
80 80
81 PP_CompletionCallback connect_callback_; 81 PP_CompletionCallback connect_callback_;
82 82
83 PP_CompletionCallback receive_callback_; 83 PP_CompletionCallback receive_callback_;
84 PP_Var* receive_callback_var_; 84 PP_Var* receive_callback_var_;
85 bool wait_for_receive_; 85 bool wait_for_receive_;
86 // TODO(toyoshim): Use std::queue<Var> when it supports binary. 86 // TODO(toyoshim): Use std::queue<Var> when it supports binary.
87 std::queue<PP_Var> received_messages_; 87 std::queue<PP_Var> received_messages_;
88 88
89 PP_CompletionCallback close_callback_; 89 PP_CompletionCallback close_callback_;
90 uint16_t close_code_; 90 uint16_t close_code_;
91 scoped_refptr< ::ppapi::StringVar> close_reason_; 91 scoped_refptr< ::ppapi::StringVar> close_reason_;
92 PP_Bool close_was_clean_; 92 PP_Bool close_was_clean_;
93 93
94 scoped_refptr< ::ppapi::StringVar> empty_string_; 94 scoped_refptr< ::ppapi::StringVar> empty_string_;
95 scoped_refptr< ::ppapi::StringVar> extensions_; 95 scoped_refptr< ::ppapi::StringVar> extensions_;
96 scoped_refptr< ::ppapi::StringVar> protocol_; 96 scoped_refptr< ::ppapi::StringVar> protocol_;
97 scoped_refptr< ::ppapi::StringVar> url_; 97 scoped_refptr< ::ppapi::StringVar> url_;
98 98
99 uint64_t buffered_amount_;
100 uint64_t buffered_amount_after_close_;
101
99 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl); 102 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl);
100 }; 103 };
101 104
102 } // namespace ppapi 105 } // namespace ppapi
103 } // namespace webkit 106 } // namespace webkit
104 107
105 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ 108 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_
OLDNEW
« no previous file with comments | « ppapi/tests/test_websocket.cc ('k') | webkit/plugins/ppapi/ppb_websocket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698