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

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

Issue 9015013: Convert callers to use the new TrackedCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months 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
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"
11 #include "ppapi/shared_impl/resource.h" 11 #include "ppapi/shared_impl/resource.h"
12 #include "ppapi/shared_impl/tracked_callback.h"
12 #include "ppapi/thunk/ppb_websocket_api.h" 13 #include "ppapi/thunk/ppb_websocket_api.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSocketClient.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSocketClient.h"
14 15
15 struct PPB_Var; 16 struct PPB_Var;
16 17
17 namespace ppapi { 18 namespace ppapi {
18 class StringVar; 19 class StringVar;
19 } 20 }
20 21
21 namespace WebKit { 22 namespace WebKit {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 ClosingHandshakeCompletionStatus status, 71 ClosingHandshakeCompletionStatus status,
71 unsigned short code, 72 unsigned short code,
72 const WebKit::WebString& reason); 73 const WebKit::WebString& reason);
73 private: 74 private:
74 int32_t DoReceive(); 75 int32_t DoReceive();
75 76
76 scoped_ptr<WebKit::WebSocket> websocket_; 77 scoped_ptr<WebKit::WebSocket> websocket_;
77 PP_WebSocketReadyState_Dev state_; 78 PP_WebSocketReadyState_Dev state_;
78 bool error_was_received_; 79 bool error_was_received_;
79 80
80 PP_CompletionCallback connect_callback_; 81 scoped_refptr< ::ppapi::TrackedCallback> connect_callback_;
81 82
82 PP_CompletionCallback receive_callback_; 83 scoped_refptr< ::ppapi::TrackedCallback> receive_callback_;
83 PP_Var* receive_callback_var_; 84 PP_Var* receive_callback_var_;
84 bool wait_for_receive_; 85 bool wait_for_receive_;
85 // TODO(toyoshim): Use std::queue<Var> when it supports binary. 86 // TODO(toyoshim): Use std::queue<Var> when it supports binary.
86 std::queue<PP_Var> received_messages_; 87 std::queue<PP_Var> received_messages_;
87 88
88 PP_CompletionCallback close_callback_; 89 scoped_refptr< ::ppapi::TrackedCallback> close_callback_;
89 uint16_t close_code_; 90 uint16_t close_code_;
90 scoped_refptr< ::ppapi::StringVar> close_reason_; 91 scoped_refptr< ::ppapi::StringVar> close_reason_;
91 PP_Bool close_was_clean_; 92 PP_Bool close_was_clean_;
92 93
93 scoped_refptr< ::ppapi::StringVar> empty_string_; 94 scoped_refptr< ::ppapi::StringVar> empty_string_;
94 scoped_refptr< ::ppapi::StringVar> extensions_; 95 scoped_refptr< ::ppapi::StringVar> extensions_;
95 scoped_refptr< ::ppapi::StringVar> url_; 96 scoped_refptr< ::ppapi::StringVar> url_;
96 97
97 uint64_t buffered_amount_; 98 uint64_t buffered_amount_;
98 uint64_t buffered_amount_after_close_; 99 uint64_t buffered_amount_after_close_;
99 100
100 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl); 101 DISALLOW_COPY_AND_ASSIGN(PPB_WebSocket_Impl);
101 }; 102 };
102 103
103 } // namespace ppapi 104 } // namespace ppapi
104 } // namespace webkit 105 } // namespace webkit
105 106
106 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_ 107 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WEBSOCKET_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698