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

Unified Diff: ppapi/proxy/plugin_resource.h

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (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
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/plugin_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_resource.h
===================================================================
--- ppapi/proxy/plugin_resource.h (revision 71973)
+++ ppapi/proxy/plugin_resource.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#define PPAPI_PROXY_PLUGIN_RESOURCE_H_
#include "base/basictypes.h"
+#include "ppapi/c/pp_instance.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
@@ -32,19 +33,20 @@
class PluginResource {
public:
- PluginResource();
+ PluginResource(PP_Instance instance);
virtual ~PluginResource();
// Returns NULL if the resource is invalid or is a different type.
template<typename T> static T* GetAs(PP_Resource res) {
PluginResource* resource =
- PluginDispatcher::Get()->plugin_resource_tracker()->GetResourceObject(
- res);
+ PluginResourceTracker::GetInstance()->GetResourceObject(res);
return resource ? resource->Cast<T>() : NULL;
}
template <typename T> T* Cast() { return NULL; }
+ PP_Instance instance() const { return instance_; }
+
private:
// Type-specific getters for individual resource types. These will return
// NULL if the resource does not match the specified type. Used by the Cast()
@@ -54,6 +56,9 @@
FOR_ALL_PLUGIN_RESOURCES(DEFINE_TYPE_GETTER)
#undef DEFINE_TYPE_GETTER
+ // Instance this resource is associated with.
+ PP_Instance instance_;
+
DISALLOW_COPY_AND_ASSIGN(PluginResource);
};
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/plugin_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698