| 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/shared_impl/private/tcp_socket_private_impl.h" | 5 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 void TCPSocketPrivateImpl::Disconnect() { | 83 void TCPSocketPrivateImpl::Disconnect() { |
| 84 DisconnectImpl(); | 84 DisconnectImpl(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 int32_t TCPSocketPrivateImpl::SetOption( | 87 int32_t TCPSocketPrivateImpl::SetOption( |
| 88 PP_TCPSocketOption_Private name, | 88 PP_TCPSocketOption_Private name, |
| 89 const PP_Var& value, | 89 const PP_Var& value, |
| 90 scoped_refptr<TrackedCallback> callback) { | 90 scoped_refptr<TrackedCallback> callback) { |
| 91 switch (name) { | 91 switch (name) { |
| 92 case PP_TCPSOCKETOPTION_INVALID: | 92 case PP_TCPSOCKETOPTION_PRIVATE_INVALID: |
| 93 return PP_ERROR_BADARGUMENT; | 93 return PP_ERROR_BADARGUMENT; |
| 94 case PP_TCPSOCKETOPTION_NO_DELAY: | 94 case PP_TCPSOCKETOPTION_PRIVATE_NO_DELAY: |
| 95 return SetOptionImpl(PP_TCPSOCKET_OPTION_NO_DELAY, value, callback); | 95 return SetOptionImpl(PP_TCPSOCKET_OPTION_NO_DELAY, value, callback); |
| 96 default: | 96 default: |
| 97 NOTREACHED(); | 97 NOTREACHED(); |
| 98 return PP_ERROR_BADARGUMENT; | 98 return PP_ERROR_BADARGUMENT; |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 Resource* TCPSocketPrivateImpl::GetOwnerResource() { | 102 Resource* TCPSocketPrivateImpl::GetOwnerResource() { |
| 103 return this; | 103 return this; |
| 104 } | 104 } |
| 105 | 105 |
| 106 int32_t TCPSocketPrivateImpl::OverridePPError(int32_t pp_error) { | 106 int32_t TCPSocketPrivateImpl::OverridePPError(int32_t pp_error) { |
| 107 // PPB_TCPSocket_Private treats all errors from the browser process as | 107 // PPB_TCPSocket_Private treats all errors from the browser process as |
| 108 // PP_ERROR_FAILED. | 108 // PP_ERROR_FAILED. |
| 109 if (pp_error < 0) | 109 if (pp_error < 0) |
| 110 return PP_ERROR_FAILED; | 110 return PP_ERROR_FAILED; |
| 111 | 111 |
| 112 return pp_error; | 112 return pp_error; |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace ppapi | 115 } // namespace ppapi |
| OLD | NEW |