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

Unified Diff: webkit/glue/plugins/pepper_resource.h

Issue 1697008: New Pepper API implementation. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « webkit/glue/plugins/pepper_plugin_module.cc ('k') | webkit/glue/plugins/pepper_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_resource.h
===================================================================
--- webkit/glue/plugins/pepper_resource.h (revision 0)
+++ webkit/glue/plugins/pepper_resource.h (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (c) 2010 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.
+
+#ifndef WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_
+#define WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_
+
+#include "base/basictypes.h"
+#include "base/ref_counted.h"
+
+typedef struct _pp_Resource PP_Resource;
+
+namespace pepper {
+
+class DeviceContext2D;
+class ImageData;
+class PluginModule;
+
+class Resource : public base::RefCountedThreadSafe<Resource> {
+ public:
+ explicit Resource(PluginModule* module);
+ virtual ~Resource();
+
+ PP_Resource GetResource() const;
+
+ PluginModule* module() const { return module_; }
+
+ // Type-specific getters for individual resource types. These will return
+ // NULL if the resource does not match the specified type.
+ virtual DeviceContext2D* AsDeviceContext2D() { return NULL; }
+ virtual ImageData* AsImageData() { return NULL; }
+
+ private:
+ PluginModule* module_; // Non-owning pointer to our module.
+
+ DISALLOW_COPY_AND_ASSIGN(Resource);
+};
+
+// Returns a "NULL" resource. This is just a helper function so callers
+// can avoid creating a resource with a 0 ID.
+PP_Resource NullPPResource();
+
+} // namespace pepper
+
+#endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_
Property changes on: webkit/glue/plugins/pepper_resource.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_module.cc ('k') | webkit/glue/plugins/pepper_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698