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

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
Index: ppapi/proxy/plugin_dispatcher.h
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index a6cc72048fa62992407a4720aa26ad5f97e65c20..9d514c47363d095bb325c950ccb02d406ee44734 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/hash_tables.h"
+#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/process.h"
@@ -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, linked_ptr<Resource> >
yzshen1 2012/11/20 21:47:25 Resource itself is a ref-counted object. You shoul
raymes 2012/11/20 23:30:23 Done.
+ SingletonResourceMap;
yzshen1 2012/11/20 21:47:25 4 space indent.
raymes 2012/11/20 23:30:23 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698