Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: ppapi/proxy/udp_socket_filter.cc

Issue 2652123003: Make ppapi/proxy child-process only (Closed)
Patch Set: component Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/tcp_socket_resource_constants.cc ('k') | ppapi/proxy/udp_socket_resource_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/udp_socket_filter.cc
diff --git a/ppapi/proxy/udp_socket_filter.cc b/ppapi/proxy/udp_socket_filter.cc
index 4928dee0947b76c479ba245f3bb0d4c305564312..85cab054613f90f4e343856c92ccbd2b87861a8e 100644
--- a/ppapi/proxy/udp_socket_filter.cc
+++ b/ppapi/proxy/udp_socket_filter.cc
@@ -14,17 +14,13 @@
#include "ppapi/proxy/error_conversion.h"
#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/proxy/udp_socket_resource_constants.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/resource_creation_api.h"
namespace ppapi {
namespace proxy {
-const int32_t UDPSocketFilter::kMaxReadSize = 128 * 1024;
-const int32_t UDPSocketFilter::kMaxReceiveBufferSize =
- 1024 * UDPSocketFilter::kMaxReadSize;
-const size_t UDPSocketFilter::kPluginReceiveBufferSlots = 32u;
-
namespace {
int32_t SetRecvFromOutput(PP_Instance pp_instance,
@@ -156,7 +152,8 @@ void UDPSocketFilter::RecvQueue::DataReceivedOnIOThread(
const std::string& data,
const PP_NetAddress_Private& addr) {
DCHECK(PluginGlobals::Get()->ipc_task_runner()->RunsTasksOnCurrentThread());
- DCHECK_LT(recv_buffers_.size(), UDPSocketFilter::kPluginReceiveBufferSlots);
+ DCHECK_LT(recv_buffers_.size(),
+ UDPSocketResourceConstants::kPluginReceiveBufferSlots);
if (!TrackedCallback::IsPending(recvfrom_callback_) || !read_buffer_) {
recv_buffers_.push(RecvBuffer());
@@ -216,7 +213,8 @@ int32_t UDPSocketFilter::RecvQueue::RequestData(
if (recv_buffers_.empty()) {
read_buffer_ = buffer_out;
- bytes_to_read_ = std::min(num_bytes, UDPSocketFilter::kMaxReadSize);
+ bytes_to_read_ =
+ std::min(num_bytes, UDPSocketResourceConstants::kMaxReadSize);
recvfrom_addr_resource_ = addr_out;
recvfrom_callback_ = callback;
return PP_OK_COMPLETIONPENDING;
« no previous file with comments | « ppapi/proxy/tcp_socket_resource_constants.cc ('k') | ppapi/proxy/udp_socket_resource_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698