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

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
Index: ppapi/proxy/dispatcher.h
===================================================================
--- ppapi/proxy/dispatcher.h (revision 72517)
+++ ppapi/proxy/dispatcher.h (working copy)
@@ -29,6 +29,7 @@
namespace IPC {
class SyncChannel;
+class TestSink;
}
namespace pp {
@@ -65,6 +66,11 @@
bool is_client,
base::WaitableEvent* shutdown_event);
+ // Alternative to Init() for unit tests that want to send all messages sent
viettrungluu 2011/01/27 16:52:58 Alternative to InitWithChannel()?
+ // 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 +110,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 +171,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') | ppapi/proxy/image_data.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698