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

Unified Diff: ppapi/proxy/dispatcher.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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/dispatcher.h ('k') | ppapi/proxy/host_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/dispatcher.cc
===================================================================
--- ppapi/proxy/dispatcher.cc (revision 72840)
+++ ppapi/proxy/dispatcher.cc (working copy)
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_sync_channel.h"
+#include "ipc/ipc_test_sink.h"
#include "ppapi/c/dev/ppb_buffer_dev.h"
#include "ppapi/c/dev/ppb_char_set_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
@@ -65,6 +66,7 @@
GetInterfaceFunc local_get_interface)
: pp_module_(0),
remote_process_handle_(remote_process_handle),
+ test_sink_(NULL),
disallow_trusted_interfaces_(false), // TODO(brettw) make this settable.
local_get_interface_(local_get_interface),
declared_supported_remote_interfaces_(false),
@@ -87,6 +89,11 @@
return true;
}
+void Dispatcher::InitWithTestSink(IPC::TestSink* test_sink) {
+ DCHECK(!test_sink_);
+ test_sink_ = test_sink;
+}
+
bool Dispatcher::OnMessageReceived(const IPC::Message& msg) {
// Control messages.
if (msg.routing_id() == MSG_ROUTING_CONTROL) {
@@ -157,6 +164,8 @@
}
bool Dispatcher::Send(IPC::Message* msg) {
+ if (test_sink_)
+ return test_sink_->Send(msg);
return channel_->Send(msg);
}
« no previous file with comments | « ppapi/proxy/dispatcher.h ('k') | ppapi/proxy/host_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698