#include "base/logging.h"
#include "content/common/view_messages.h"
-#include "content/renderer/pepper/common.h"
#include "content/renderer/pepper/host_globals.h"
#include "content/renderer/pepper/pepper_broker.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
: Resource(ppapi::OBJECT_IS_IMPL, instance),
broker_(NULL),
connect_callback_(),
- pipe_handle_(PlatformFileToInt(base::kInvalidPlatformFileValue)),
+ pipe_handle_(PlatformFileToInt(base::SyncSocket::kInvalidHandle)),
routing_id_(RenderThreadImpl::current()->GenerateRoutingID()) {
- ChildThread::current()->AddRoute(routing_id_, this);
+ ChildThread::current()->GetRouter()->AddRoute(routing_id_, this);
}
PPB_Broker_Impl::~PPB_Broker_Impl() {
}
// The plugin owns the handle.
- pipe_handle_ = PlatformFileToInt(base::kInvalidPlatformFileValue);
- ChildThread::current()->RemoveRoute(routing_id_);
+ pipe_handle_ = PlatformFileToInt(base::SyncSocket::kInvalidHandle);
+ ChildThread::current()->GetRouter()->RemoveRoute(routing_id_);
}
-PPB_Broker_API* PPB_Broker_Impl::AsPPB_Broker_API() {
- return this;
-}
+PPB_Broker_API* PPB_Broker_Impl::AsPPB_Broker_API() { return this; }
int32_t PPB_Broker_Impl::Connect(
scoped_refptr<TrackedCallback> connect_callback) {
broker_ = new PepperBroker(module);
// Have the browser start the broker process for us.
- RenderThreadImpl::current()->Send(new ViewHostMsg_OpenChannelToPpapiBroker(
- routing_id_, broker_path));
+ RenderThreadImpl::current()->Send(
+ new ViewHostMsg_OpenChannelToPpapiBroker(routing_id_, broker_path));
}
RenderThreadImpl::current()->Send(
new ViewHostMsg_RequestPpapiBrokerPermission(
- plugin_instance->render_view()->GetRoutingID(),
+ plugin_instance->render_frame()->render_view()->GetRoutingID(),
routing_id_,
GetDocumentUrl(),
broker_path));
}
int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) {
- if (pipe_handle_ == PlatformFileToInt(base::kInvalidPlatformFileValue))
+ if (pipe_handle_ == PlatformFileToInt(base::SyncSocket::kInvalidHandle))
return PP_ERROR_FAILED; // Handle not set yet.
*handle = pipe_handle_;
return PP_OK;
// Transfers ownership of the handle to the plugin.
void PPB_Broker_Impl::BrokerConnected(int32_t handle, int32_t result) {
- DCHECK(pipe_handle_ ==
- PlatformFileToInt(base::kInvalidPlatformFileValue));
+ DCHECK(pipe_handle_ == PlatformFileToInt(base::SyncSocket::kInvalidHandle));
DCHECK(result == PP_OK ||
- handle == PlatformFileToInt(base::kInvalidPlatformFileValue));
+ handle == PlatformFileToInt(base::SyncSocket::kInvalidHandle));
pipe_handle_ = handle;