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

Unified Diff: ppapi/shared_impl/var_tracker.h

Issue 9609008: Implemented Browser Plugin (NOT FOR REVIEW) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge with ToT. GuestToEmbedderChannel is now Dispatcher. Created 8 years, 7 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/proxy/proxy_object_var.cc ('k') | webkit/plugins/ppapi/ppapi_webplugin_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/var_tracker.h
diff --git a/ppapi/shared_impl/var_tracker.h b/ppapi/shared_impl/var_tracker.h
index 9ab22f2d02a00a3aac785473cbcd82562efe3dab..c06f83c0c941daee7ea171de4335e316768913d0 100644
--- a/ppapi/shared_impl/var_tracker.h
+++ b/ppapi/shared_impl/var_tracker.h
@@ -20,6 +20,10 @@ namespace ppapi {
class ArrayBufferVar;
class Var;
+namespace proxy {
+class Dispatcher;
+}
+
// Tracks non-POD (refcounted) var objects held by a plugin.
//
// The tricky part is the concept of a "tracked object". These are only
@@ -84,6 +88,38 @@ class PPAPI_SHARED_EXPORT VarTracker
int GetRefCountForObject(const PP_Var& object);
int GetTrackedWithNoReferenceCountForObject(const PP_Var& object);
+ // Manages tracking for receiving a VARTYPE_OBJECT from the remote side
+ // (either the plugin or the renderer) that has already had its reference
+ // count incremented on behalf of the caller.
+ virtual PP_Var ReceiveObjectPassRef(const PP_Var& var,
+ proxy::Dispatcher* dispatcher) {
+ return PP_Var();
+ }
+
+ // See the comment in var_tracker.h for more about what a tracked object is.
+ // This adds and releases the "track_with_no_reference_count" for a given
+ // object.
+ virtual PP_Var TrackObjectWithNoReference(const PP_Var& host_var,
+ proxy::Dispatcher* dispatcher) {
+ return PP_Var();
+ }
+
+ virtual void StopTrackingObjectWithNoReference(const PP_Var& plugin_var) { }
+
+ // Returns the host var for the corresponding plugin object var. The object
+ // should be a VARTYPE_OBJECT. The reference count is not affeceted.
+ virtual PP_Var GetHostObject(const PP_Var& plugin_object) const {
+ return PP_Var();
+ }
+
+ virtual proxy::Dispatcher* DispatcherForPluginObject(
+ const PP_Var& plugin_object) const { return NULL; }
+
+ // Like Release() but the var is identified by its host object ID (as
+ // returned by GetHostObject).
+ void ReleaseHostObject(proxy::Dispatcher* dispatcher,
+ const PP_Var& host_object) {}
+
protected:
struct VarInfo {
VarInfo();
« no previous file with comments | « ppapi/proxy/proxy_object_var.cc ('k') | webkit/plugins/ppapi/ppapi_webplugin_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698