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 #include "ppapi/cpp/dev/websocket_dev.h" | 5 #include "ppapi/cpp/dev/websocket_dev.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/pp_macros.h" | 8 #include "ppapi/c/pp_macros.h" |
9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
10 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 Var WebSocket_Dev::GetURL() { | 140 Var WebSocket_Dev::GetURL() { |
141 if (!has_interface<PPB_WebSocket_Dev>()) | 141 if (!has_interface<PPB_WebSocket_Dev>()) |
142 return Var(); | 142 return Var(); |
143 | 143 |
144 return Var(Var::PassRef(), | 144 return Var(Var::PassRef(), |
145 get_interface<PPB_WebSocket_Dev>()->GetURL(pp_resource())); | 145 get_interface<PPB_WebSocket_Dev>()->GetURL(pp_resource())); |
146 } | 146 } |
147 | 147 |
148 bool WebSocket_Dev::SetBinaryType(PP_WebSocketBinaryType_Dev binary_type) { | |
149 if (!has_interface<PPB_WebSocket_Dev>()) | |
150 return false; | |
151 return PP_ToBool(get_interface<PPB_WebSocket_Dev>()->SetBinaryType( | |
152 pp_resource(), binary_type)); | |
153 } | |
154 | |
155 PP_WebSocketBinaryType_Dev WebSocket_Dev::GetBinaryType() { | |
156 if (!has_interface<PPB_WebSocket_Dev>()) | |
157 return PP_WEBSOCKETBINARYTYPE_INVALID; | |
158 return get_interface<PPB_WebSocket_Dev>()->GetBinaryType(pp_resource()); | |
159 } | |
160 | |
161 } // namespace pp | 148 } // namespace pp |
OLD | NEW |