summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 22:10:57 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 22:10:57 +0000
commit9d9f1bb2aa1bd6db5e04e8ebd586f924d2532964 (patch)
treecf4e64950dfe2832ff011fdf2daa3e567e159b0d /ppapi
parent7b978a7cf153257e6020638907389be85f054d8c (diff)
downloadchromium_src-9d9f1bb2aa1bd6db5e04e8ebd586f924d2532964.zip
chromium_src-9d9f1bb2aa1bd6db5e04e8ebd586f924d2532964.tar.gz
chromium_src-9d9f1bb2aa1bd6db5e04e8ebd586f924d2532964.tar.bz2
PPB_Flash cleanup part 1: move the net connector stuff to its own files.
BUG=none TEST=builds Review URL: http://codereview.chromium.org/6578007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/private/ppb_flash.h38
-rw-r--r--ppapi/c/private/ppb_flash_net_connector.h46
-rw-r--r--ppapi/cpp/private/flash_net_connector.cc (renamed from ppapi/cpp/private/flash.cc)2
-rw-r--r--ppapi/cpp/private/flash_net_connector.h (renamed from ppapi/cpp/private/flash.h)14
-rw-r--r--ppapi/ppapi_cpp.gypi1
5 files changed, 55 insertions, 46 deletions
diff --git a/ppapi/c/private/ppb_flash.h b/ppapi/c/private/ppb_flash.h
index 4825fe4..c602278 100644
--- a/ppapi/c/private/ppb_flash.h
+++ b/ppapi/c/private/ppb_flash.h
@@ -10,15 +10,12 @@
#endif
#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_point.h"
#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_var.h"
-// PPB_Flash -------------------------------------------------------------------
-
#define PPB_FLASH_INTERFACE "PPB_Flash;6"
#ifdef _WIN32
@@ -129,39 +126,4 @@ struct PPB_Flash {
void (*QuitMessageLoop)(PP_Instance instance);
};
-// PPB_Flash_NetConnector ------------------------------------------------------
-
-#define PPB_FLASH_NETCONNECTOR_INTERFACE "PPB_Flash_NetConnector;1"
-
-// This is an opaque type holding a network address.
-struct PP_Flash_NetAddress {
- size_t size;
- char data[128];
-};
-
-struct PPB_Flash_NetConnector {
- PP_Resource (*Create)(PP_Instance instance_id);
- PP_Bool (*IsFlashNetConnector)(PP_Resource resource_id);
-
- // Connect to a TCP port given as a host-port pair. The local and remote
- // addresses of the connection (if successful) are returned in
- // |local_addr_out| and |remote_addr_out|, respectively, if non-null.
- int32_t (*ConnectTcp)(PP_Resource connector_id,
- const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- struct PP_Flash_NetAddress* local_addr_out,
- struct PP_Flash_NetAddress* remote_addr_out,
- struct PP_CompletionCallback callback);
-
- // Same as |ConnectTcp()|, but connecting to the address given by |addr|. A
- // typical use-case would be for reconnections.
- int32_t (*ConnectTcpAddress)(PP_Resource connector_id,
- const struct PP_Flash_NetAddress* addr,
- PP_FileHandle* socket_out,
- struct PP_Flash_NetAddress* local_addr_out,
- struct PP_Flash_NetAddress* remote_addr_out,
- struct PP_CompletionCallback callback);
-};
-
#endif // PPAPI_C_PRIVATE_PPB_FLASH_H_
diff --git a/ppapi/c/private/ppb_flash_net_connector.h b/ppapi/c/private/ppb_flash_net_connector.h
new file mode 100644
index 0000000..3ca6411
--- /dev/null
+++ b/ppapi/c/private/ppb_flash_net_connector.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 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.
+
+#ifndef PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_
+#define PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_
+
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/private/ppb_flash.h" // For |PP_FileHandle|.
+
+#define PPB_FLASH_NETCONNECTOR_INTERFACE "PPB_Flash_NetConnector;1"
+
+// This is an opaque type holding a network address.
+struct PP_Flash_NetAddress {
+ size_t size;
+ char data[128];
+};
+
+struct PPB_Flash_NetConnector {
+ PP_Resource (*Create)(PP_Instance instance_id);
+ PP_Bool (*IsFlashNetConnector)(PP_Resource resource_id);
+
+ // Connect to a TCP port given as a host-port pair. The local and remote
+ // addresses of the connection (if successful) are returned in
+ // |local_addr_out| and |remote_addr_out|, respectively, if non-null.
+ int32_t (*ConnectTcp)(PP_Resource connector_id,
+ const char* host,
+ uint16_t port,
+ PP_FileHandle* socket_out,
+ struct PP_Flash_NetAddress* local_addr_out,
+ struct PP_Flash_NetAddress* remote_addr_out,
+ struct PP_CompletionCallback callback);
+
+ // Same as |ConnectTcp()|, but connecting to the address given by |addr|. A
+ // typical use-case would be for reconnections.
+ int32_t (*ConnectTcpAddress)(PP_Resource connector_id,
+ const struct PP_Flash_NetAddress* addr,
+ PP_FileHandle* socket_out,
+ struct PP_Flash_NetAddress* local_addr_out,
+ struct PP_Flash_NetAddress* remote_addr_out,
+ struct PP_CompletionCallback callback);
+};
+
+#endif // PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash_net_connector.cc
index 5af96bc..8896114 100644
--- a/ppapi/cpp/private/flash.cc
+++ b/ppapi/cpp/private/flash_net_connector.cc
@@ -4,7 +4,7 @@
// TODO(viettrungluu): See the comment in corresponding .h file.
-#include "ppapi/cpp/private/flash.h"
+#include "ppapi/cpp/private/flash_net_connector.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/cpp/completion_callback.h"
diff --git a/ppapi/cpp/private/flash.h b/ppapi/cpp/private/flash_net_connector.h
index ffd1353..56df193 100644
--- a/ppapi/cpp/private/flash.h
+++ b/ppapi/cpp/private/flash_net_connector.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(viettrungluu): This (and the .cc file) contain C++ wrappers for some
-// things in ppapi/c/private/ppb_flash.h. This is currently not used in (or even
-// compiled with) Chromium.
+// TODO(viettrungluu): This (and the .cc file) contain C++ wrappers for things
+// in ppapi/c/private/ppb_flash_net_connector.h. This is currently not used in
+// (or even compiled with) Chromium.
-#ifndef PPAPI_CPP_PRIVATE_FLASH_H_
-#define PPAPI_CPP_PRIVATE_FLASH_H_
+#ifndef PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
+#define PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
-#include "ppapi/c/private/ppb_flash.h"
+#include "ppapi/c/private/ppb_flash_net_connector.h"
#include "ppapi/cpp/resource.h"
namespace pp {
@@ -39,4 +39,4 @@ class NetConnector : public Resource {
} // namespace flash
} // namespace pp
-#endif // PPAPI_CPP_PRIVATE_FLASH_H_
+#endif // PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi
index 05efe6b..36840d9 100644
--- a/ppapi/ppapi_cpp.gypi
+++ b/ppapi/ppapi_cpp.gypi
@@ -83,6 +83,7 @@
# Private interfaces.
'c/private/ppb_flash.h',
'c/private/ppb_flash_menu.h',
+ 'c/private/ppb_flash_net_connector.h',
'c/private/ppb_nacl_private.h',
'c/private/ppb_pdf.h',
'c/private/ppb_proxy_private.h',