Skip to content

Commit

Permalink
Move PPB_UDPSocket out of dev.
Browse files Browse the repository at this point in the history
BUG=247225
TEST=None

Review URL: https://chromiumcodereview.appspot.com/17094015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208145 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
yzshen@chromium.org committed Jun 24, 2013
1 parent 57d2dfa commit 8de1329
Show file tree
Hide file tree
Showing 31 changed files with 292 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost(
return scoped_ptr<ResourceHost>(new PepperFileRefHost(
host_, instance, params.pp_resource(), file_system, internal_path));
}
case PpapiHostMsg_UDPSocket_Create::ID: {
scoped_refptr<ResourceMessageFilter> udp_socket(
new PepperUDPSocketMessageFilter(host_, instance, false));
return scoped_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, params.pp_resource(), udp_socket));
}
}

// Dev interfaces.
Expand All @@ -96,12 +102,6 @@ scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost(
return scoped_ptr<ResourceHost>(new PepperTrueTypeFontListHost(
host_, instance, params.pp_resource()));
}
case PpapiHostMsg_UDPSocket_Create::ID: {
scoped_refptr<ResourceMessageFilter> udp_socket(
new PepperUDPSocketMessageFilter(host_, instance, false));
return scoped_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, params.pp_resource(), udp_socket));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int32_t PepperUDPSocketMessageFilter::OnResourceMessageReceived(

int32_t PepperUDPSocketMessageFilter::OnMsgSetOption(
const ppapi::host::HostMessageContext* context,
PP_UDPSocket_Option_Dev name,
PP_UDPSocket_Option name,
const ppapi::SocketOptionData& value) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include "content/public/common/process_type.h"
#include "net/base/completion_callback.h"
#include "net/base/ip_endpoint.h"
#include "ppapi/c/dev/ppb_udp_socket_dev.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb_udp_socket.h"
#include "ppapi/host/resource_message_filter.h"

struct PP_NetAddress_Private;
Expand Down Expand Up @@ -63,7 +63,7 @@ class CONTENT_EXPORT PepperUDPSocketMessageFilter

int32_t OnMsgSetOption(
const ppapi::host::HostMessageContext* context,
PP_UDPSocket_Option_Dev name,
PP_UDPSocket_Option name,
const ppapi::SocketOptionData& value);
int32_t OnMsgBind(const ppapi::host::HostMessageContext* context,
const PP_NetAddress_Private& addr);
Expand Down
6 changes: 3 additions & 3 deletions native_client_sdk/src/build_tools/sdk_files.list
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ include/ppapi/c/dev/ppb_testing_dev.h
include/ppapi/c/dev/ppb_text_input_dev.h
include/ppapi/c/dev/ppb_trace_event_dev.h
include/ppapi/c/dev/ppb_truetype_font_dev.h
include/ppapi/c/dev/ppb_udp_socket_dev.h
include/ppapi/c/dev/ppb_url_util_dev.h
include/ppapi/c/dev/ppb_var_deprecated.h
include/ppapi/c/dev/ppb_video_capture_dev.h
Expand Down Expand Up @@ -341,6 +340,7 @@ include/ppapi/c/ppb_net_address.h
include/ppapi/c/pp_bool.h
include/ppapi/c/ppb_opengles2.h
include/ppapi/c/ppb_tcp_socket.h
include/ppapi/c/ppb_udp_socket.h
include/ppapi/c/ppb_url_loader.h
include/ppapi/c/ppb_url_request_info.h
include/ppapi/c/ppb_url_response_info.h
Expand Down Expand Up @@ -391,7 +391,6 @@ include/ppapi/cpp/dev/scrollbar_dev.h
include/ppapi/cpp/dev/selection_dev.h
include/ppapi/cpp/dev/text_input_dev.h
include/ppapi/cpp/dev/truetype_font_dev.h
include/ppapi/cpp/dev/udp_socket_dev.h
include/ppapi/cpp/dev/url_util_dev.h
include/ppapi/cpp/dev/video_capture_client_dev.h
include/ppapi/cpp/dev/video_capture_dev.h
Expand Down Expand Up @@ -459,6 +458,7 @@ include/ppapi/cpp/tcp_socket.h
include/ppapi/c/pp_time.h
include/ppapi/c/pp_touch_point.h
include/ppapi/cpp/touch_point.h
include/ppapi/cpp/udp_socket.h
include/ppapi/cpp/url_loader.h
include/ppapi/cpp/url_request_info.h
include/ppapi/cpp/url_response_info.h
Expand Down Expand Up @@ -738,7 +738,7 @@ src/ppapi_cpp/socket_dev.cc
src/ppapi_cpp/tcp_socket.cc
src/ppapi_cpp/text_input_dev.cc
src/ppapi_cpp/truetype_font_dev.cc
src/ppapi_cpp/udp_socket_dev.cc
src/ppapi_cpp/udp_socket.cc
src/ppapi_cpp/url_loader.cc
src/ppapi_cpp/url_request_info.cc
src/ppapi_cpp/url_response_info.cc
Expand Down
2 changes: 1 addition & 1 deletion native_client_sdk/src/libraries/ppapi/library.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'pp_bool.h',
'ppb_opengles2.h',
'ppb_tcp_socket.h',
'ppb_udp_socket.h',
'ppb_url_loader.h',
'ppb_url_request_info.h',
'ppb_url_response_info.h',
Expand Down Expand Up @@ -103,7 +104,6 @@
'ppb_text_input_dev.h',
'ppb_trace_event_dev.h',
'ppb_truetype_font_dev.h',
'ppb_udp_socket_dev.h',
'ppb_url_util_dev.h',
'ppb_var_deprecated.h',
'ppb_video_capture_dev.h',
Expand Down
4 changes: 2 additions & 2 deletions native_client_sdk/src/libraries/ppapi_cpp/library.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'rect.cc',
'resource.cc',
'tcp_socket.cc',
'udp_socket.cc',
'url_loader.cc',
'url_request_info.cc',
'url_response_info.cc',
Expand All @@ -58,7 +59,6 @@
'video_capture_client_dev.cc',
'video_decoder_client_dev.cc',
'crypto_dev.cc',
'udp_socket_dev.cc',
'selection_dev.cc',
'buffer_dev.cc',
'url_util_dev.cc',
Expand Down Expand Up @@ -140,6 +140,7 @@
'size.h',
'tcp_socket.h',
'touch_point.h',
'udp_socket.h',
'url_loader.h',
'url_request_info.h',
'url_response_info.h',
Expand Down Expand Up @@ -173,7 +174,6 @@
'selection_dev.h',
'text_input_dev.h',
'truetype_font_dev.h',
'udp_socket_dev.h',
'url_util_dev.h',
'video_capture_client_dev.h',
'video_capture_dev.h',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
*/

/**
* This file defines the <code>PPB_UDPSocket_Dev</code> interface.
* This file defines the <code>PPB_UDPSocket</code> interface.
*/

[generate_thunk]

label Chrome {
M29 = 0.1
M29 = 1.0
};

/**
* Option names used by <code>SetOption()</code>.
*/
[assert_size(4)]
enum PP_UDPSocket_Option_Dev {
enum PP_UDPSocket_Option {
/**
* Allows the socket to share the local address to which it will be bound with
* other processes. Value's type should be <code>PP_VARTYPE_BOOL</code>.
Expand Down Expand Up @@ -56,15 +56,15 @@ enum PP_UDPSocket_Option_Dev {
};

/**
* The <code>PPB_UDPSocket_Dev</code> interface provides UDP socket operations.
* The <code>PPB_UDPSocket</code> interface provides UDP socket operations.
*
* Permissions: Apps permission <code>socket</code> with subrule
* <code>udp-bind</code> is required for <code>Bind()</code>; subrule
* <code>udp-send-to</code> is required for <code>SendTo()</code>.
* For more details about network communication permissions, please see:
* http://developer.chrome.com/apps/app_network.html
*/
interface PPB_UDPSocket_Dev {
interface PPB_UDPSocket {
/**
* Creates a UDP socket resource.
*
Expand All @@ -81,9 +81,8 @@ interface PPB_UDPSocket_Dev {
*
* @param[in] resource A <code>PP_Resource</code> to check.
*
* @return <code>PP_TRUE</code> if the input is a
* <code>PPB_UDPSocket_Dev</code> resource; <code>PP_FALSE</code>
* otherwise.
* @return <code>PP_TRUE</code> if the input is a <code>PPB_UDPSocket</code>
* resource; <code>PP_FALSE</code> otherwise.
*/
PP_Bool IsUDPSocket([in] PP_Resource resource);

Expand Down Expand Up @@ -178,7 +177,7 @@ interface PPB_UDPSocket_Dev {

/**
* Sets a socket option on the UDP socket.
* Please see the <code>PP_UDPSocket_Option_Dev</code> description for option
* Please see the <code>PP_UDPSocket_Option</code> description for option
* names, value types and allowed values.
*
* @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
Expand All @@ -191,7 +190,7 @@ interface PPB_UDPSocket_Dev {
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
int32_t SetOption([in] PP_Resource udp_socket,
[in] PP_UDPSocket_Option_Dev name,
[in] PP_UDPSocket_Option name,
[in] PP_Var value,
[in] PP_CompletionCallback callback);
};
33 changes: 16 additions & 17 deletions ppapi/c/dev/ppb_udp_socket_dev.h → ppapi/c/ppb_udp_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* found in the LICENSE file.
*/

/* From dev/ppb_udp_socket_dev.idl modified Thu Jun 20 15:15:36 2013. */
/* From ppb_udp_socket.idl modified Sat Jun 22 10:56:26 2013. */

#ifndef PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_
#define PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_
#ifndef PPAPI_C_PPB_UDP_SOCKET_H_
#define PPAPI_C_PPB_UDP_SOCKET_H_

#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_completion_callback.h"
Expand All @@ -16,12 +16,12 @@
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"

#define PPB_UDPSOCKET_DEV_INTERFACE_0_1 "PPB_UDPSocket(Dev);0.1"
#define PPB_UDPSOCKET_DEV_INTERFACE PPB_UDPSOCKET_DEV_INTERFACE_0_1
#define PPB_UDPSOCKET_INTERFACE_1_0 "PPB_UDPSocket;1.0"
#define PPB_UDPSOCKET_INTERFACE PPB_UDPSOCKET_INTERFACE_1_0

/**
* @file
* This file defines the <code>PPB_UDPSocket_Dev</code> interface.
* This file defines the <code>PPB_UDPSocket</code> interface.
*/


Expand Down Expand Up @@ -65,8 +65,8 @@ typedef enum {
* guarantee it will conform to the size.
*/
PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3
} PP_UDPSocket_Option_Dev;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocket_Option_Dev, 4);
} PP_UDPSocket_Option;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocket_Option, 4);
/**
* @}
*/
Expand All @@ -76,15 +76,15 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocket_Option_Dev, 4);
* @{
*/
/**
* The <code>PPB_UDPSocket_Dev</code> interface provides UDP socket operations.
* The <code>PPB_UDPSocket</code> interface provides UDP socket operations.
*
* Permissions: Apps permission <code>socket</code> with subrule
* <code>udp-bind</code> is required for <code>Bind()</code>; subrule
* <code>udp-send-to</code> is required for <code>SendTo()</code>.
* For more details about network communication permissions, please see:
* http://developer.chrome.com/apps/app_network.html
*/
struct PPB_UDPSocket_Dev_0_1 {
struct PPB_UDPSocket_1_0 {
/**
* Creates a UDP socket resource.
*
Expand All @@ -100,9 +100,8 @@ struct PPB_UDPSocket_Dev_0_1 {
*
* @param[in] resource A <code>PP_Resource</code> to check.
*
* @return <code>PP_TRUE</code> if the input is a
* <code>PPB_UDPSocket_Dev</code> resource; <code>PP_FALSE</code>
* otherwise.
* @return <code>PP_TRUE</code> if the input is a <code>PPB_UDPSocket</code>
* resource; <code>PP_FALSE</code> otherwise.
*/
PP_Bool (*IsUDPSocket)(PP_Resource resource);
/**
Expand Down Expand Up @@ -191,7 +190,7 @@ struct PPB_UDPSocket_Dev_0_1 {
void (*Close)(PP_Resource udp_socket);
/**
* Sets a socket option on the UDP socket.
* Please see the <code>PP_UDPSocket_Option_Dev</code> description for option
* Please see the <code>PP_UDPSocket_Option</code> description for option
* names, value types and allowed values.
*
* @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
Expand All @@ -204,15 +203,15 @@ struct PPB_UDPSocket_Dev_0_1 {
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
int32_t (*SetOption)(PP_Resource udp_socket,
PP_UDPSocket_Option_Dev name,
PP_UDPSocket_Option name,
struct PP_Var value,
struct PP_CompletionCallback callback);
};

typedef struct PPB_UDPSocket_Dev_0_1 PPB_UDPSocket_Dev;
typedef struct PPB_UDPSocket_1_0 PPB_UDPSocket;
/**
* @}
*/

#endif /* PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ */
#endif /* PPAPI_C_PPB_UDP_SOCKET_H_ */

Loading

0 comments on commit 8de1329

Please sign in to comment.