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

Unified Diff: ppapi/proxy/dispatcher.h

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/ppapi_tests.gypi ('k') | ppapi/proxy/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/dispatcher.h
===================================================================
--- ppapi/proxy/dispatcher.h (revision 72840)
+++ ppapi/proxy/dispatcher.h (working copy)
@@ -29,6 +29,7 @@
namespace IPC {
class SyncChannel;
+class TestSink;
}
namespace pp {
@@ -60,11 +61,17 @@
~Dispatcher();
+ // You must call this function before anything else. Returns true on success.
bool InitWithChannel(MessageLoop* ipc_message_loop,
const IPC::ChannelHandle& channel_handle,
bool is_client,
base::WaitableEvent* shutdown_event);
+ // Alternative to InitWithChannel() for unit tests that want to send all
+ // messages sent via this dispatcher to the given test sink. The test sink
+ // must outlive this class.
+ void InitWithTestSink(IPC::TestSink* test_sink);
+
// Returns true if the dispatcher is on the plugin side, or false if it's the
// browser side.
virtual bool IsPlugin() const = 0;
@@ -104,6 +111,7 @@
// IPC::Channel::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& msg);
+ // Will be NULL in some unit tests.
IPC::SyncChannel* channel() const {
return channel_.get();
}
@@ -164,6 +172,13 @@
PP_Module pp_module_;
base::ProcessHandle remote_process_handle_; // See getter above.
+
+ // When we're unit testing, this will indicate the sink for the messages to
+ // be deposited so they can be inspected by the test. When non-NULL, this
+ // indicates that the channel should not be used.
+ IPC::TestSink* test_sink_;
+
+ // Will be null for some tests when there is a test_sink_.
scoped_ptr<IPC::SyncChannel> channel_;
bool disallow_trusted_interfaces_;
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698