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

Unified Diff: ppapi/proxy/plugin_dispatcher.h

Issue 11359063: Refactor the way singleton-style resources are exposed via PPB_Instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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/gamepad_resource.cc ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_dispatcher.h
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index a6cc72048fa62992407a4720aa26ad5f97e65c20..f944d45f8249dc90f182b93d29f0bbf1023ca3aa 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -20,6 +20,7 @@
#include "ppapi/proxy/dispatcher.h"
#include "ppapi/shared_impl/ppapi_preferences.h"
#include "ppapi/shared_impl/ppb_view_shared.h"
+#include "ppapi/shared_impl/singleton_resource_id.h"
#include "ppapi/shared_impl/tracked_callback.h"
namespace ppapi {
@@ -51,11 +52,10 @@ struct InstanceData {
// When non-NULL, indicates the callback to execute when mouse lock is lost.
scoped_refptr<TrackedCallback> mouse_lock_callback;
- // The following are lazily created the first time the plugin requests them.
- // (These are singleton-style resources).
- scoped_refptr<GamepadResource> gamepad_resource;
- scoped_refptr<FlashResource> flash_resource;
- scoped_refptr<FlashClipboardResource> flash_clipboard_resource;
+ // A map of singleton resources which are lazily created.
+ typedef std::map<SingletonResourceID, scoped_refptr<Resource> >
+ SingletonResourceMap;
+ SingletonResourceMap singleton_resources;
// Calls to |RequestSurroundingText()| are done by posted tasks. Track whether
// a) a task is pending, to avoid redundant calls, and b) whether we should
« no previous file with comments | « ppapi/proxy/gamepad_resource.cc ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698