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

Unified Diff: ppapi/proxy/dispatcher.h

Issue 6628019: Ensure that PP_Instance values are unique within a plugin process in addition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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_shared_proxy.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 77663)
+++ ppapi/proxy/dispatcher.h (working copy)
@@ -6,6 +6,7 @@
#define PPAPI_PROXY_DISPATCHER_H_
#include <map>
+#include <set>
#include <string>
#include <vector>
@@ -16,6 +17,7 @@
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_platform_file.h"
+#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/proxy/callback_tracker.h"
#include "ppapi/proxy/interface_id.h"
@@ -60,13 +62,31 @@
typedef int32_t (*InitModuleFunc)(PP_Module, GetInterfaceFunc);
typedef void (*ShutdownModuleFunc)();
+ class Delegate {
+ public:
+ // Returns the dedicated message loop for processing IPC requests.
+ virtual MessageLoop* GetIPCMessageLoop() = 0;
+
+ // Returns the event object that becomes signalled when the main thread's
+ // message loop exits.
+ virtual base::WaitableEvent* GetShutdownEvent() = 0;
+
+ // Returns the set used for globally uniquifying PP_Instances. This same
+ // set must be returned for all channels. This is required only for the
+ // plugin side, for the host side, the return value may be NULL.
+ //
+ // DEREFERENCE ONLY ON THE I/O THREAD.
+ virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() = 0;
+ };
+
virtual ~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);
+ // The delegate pointer must outlive this class, ownership is not
+ // transferred.
+ virtual bool InitWithChannel(Delegate* delegate,
+ const IPC::ChannelHandle& channel_handle,
+ bool is_client);
// Alternative to InitWithChannel() for unit tests that want to send all
// messages sent via this dispatcher to the given test sink. The test sink
@@ -137,7 +157,12 @@
return disallow_trusted_interfaces_;
}
+ Delegate* delegate() { return delegate_; }
+
private:
+ // Non-owning pointer. Guaranteed non-NULL after init is called.
+ Delegate* delegate_;
+
base::ProcessHandle remote_process_handle_; // See getter above.
// When we're unit testing, this will indicate the sink for the messages to
« no previous file with comments | « ppapi/ppapi_shared_proxy.gypi ('k') | ppapi/proxy/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698