Chromium Code Reviews| Index: ppapi/proxy/tcp_socket_private_resource.h |
| diff --git a/ppapi/shared_impl/private/tcp_socket_private_impl.h b/ppapi/proxy/tcp_socket_private_resource.h |
| similarity index 61% |
| rename from ppapi/shared_impl/private/tcp_socket_private_impl.h |
| rename to ppapi/proxy/tcp_socket_private_resource.h |
| index 36303fa769177d15417e518f5c9b07f1d6bc97dc..3258e7848b701d5afa9e803f74297298b446f15b 100644 |
| --- a/ppapi/shared_impl/private/tcp_socket_private_impl.h |
| +++ b/ppapi/proxy/tcp_socket_private_resource.h |
| @@ -1,35 +1,32 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
|
yzshen1
2013/08/16 20:40:42
Please add #ifndef / #define
ygorshenin1
2013/08/19 14:33:35
Done.
|
| -#ifndef PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ |
| -#define PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ |
| - |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| -#include "ppapi/shared_impl/resource.h" |
| -#include "ppapi/shared_impl/tcp_socket_shared.h" |
| +#include "ppapi/proxy/tcp_socket_resource_base.h" |
| #include "ppapi/thunk/ppb_tcp_socket_private_api.h" |
| namespace ppapi { |
| +namespace proxy { |
| -// This class provides the shared implementation of a |
| -// PPB_TCPSocket_Private. The functions that actually send messages |
| -// to browser are implemented differently for the proxied and |
| -// non-proxied derived classes. |
| -class PPAPI_SHARED_EXPORT TCPSocketPrivateImpl |
| +class PPAPI_PROXY_EXPORT TCPSocketPrivateResource |
| : public thunk::PPB_TCPSocket_Private_API, |
| - public Resource, |
| - public TCPSocketShared { |
| + public TCPSocketResourceBase { |
| public: |
| - // C-tor used in Impl case. |
| - TCPSocketPrivateImpl(PP_Instance instance, uint32 socket_id); |
| - // C-tor used in Proxy case. |
| - TCPSocketPrivateImpl(const HostResource& resource, uint32 socket_id); |
| + // C-tor used for new sockets. |
| + TCPSocketPrivateResource(Connection connection, PP_Instance instance); |
| + |
| + // C-tor used for already accepted sockets. |
| + TCPSocketPrivateResource(Connection connection, |
| + PP_Instance instance, |
| + int pending_resource_id, |
| + const PP_NetAddress_Private& local_addr, |
| + const PP_NetAddress_Private& remote_addr); |
| - virtual ~TCPSocketPrivateImpl(); |
| + virtual ~TCPSocketPrivateResource(); |
| - // Resource overrides. |
| + // PluginResource overrides. |
| virtual PPB_TCPSocket_Private_API* AsPPB_TCPSocket_Private_API() OVERRIDE; |
| // PPB_TCPSocket_Private_API implementation. |
| @@ -59,16 +56,9 @@ class PPAPI_SHARED_EXPORT TCPSocketPrivateImpl |
| const PP_Var& value, |
| scoped_refptr<TrackedCallback> callback) OVERRIDE; |
| - // TCPSocketShared implementation. |
| - virtual Resource* GetOwnerResource() OVERRIDE; |
| - |
| - // TCPSocketShared overrides. |
| - virtual int32_t OverridePPError(int32_t pp_error) OVERRIDE; |
| - |
| private: |
| - DISALLOW_COPY_AND_ASSIGN(TCPSocketPrivateImpl); |
| + DISALLOW_COPY_AND_ASSIGN(TCPSocketPrivateResource); |
| }; |
| +} // namespace proxy |
| } // namespace ppapi |
| - |
| -#endif // PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ |