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

Unified Diff: ppapi/cpp/resource.h

Issue 7054060: New documentation for resource.h, core.h, and common.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/cpp/core.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/resource.h
===================================================================
--- ppapi/cpp/resource.h (revision 88128)
+++ ppapi/cpp/resource.h (working copy)
@@ -7,41 +7,67 @@
#include "ppapi/c/pp_resource.h"
+/// @file
+/// This file defines a Resource type representing data associated
+/// with the module.
namespace pp {
-// Base class for refcounted plugin resources.
+/// A reference counted module resource.
class Resource {
public:
+
+ /// The default constructor.
Resource();
+
+ /// A constructor for copying a resource.
+ ///
+ /// @param[in] other A Resource.
Resource(const Resource& other);
+ /// Destructor.
virtual ~Resource();
+ /// This function assigns one Resource to another Resource.
+ ///
+ /// @param[in] other A Resource.
+ /// @return A Resource containing the assigned Resource.
Resource& operator=(const Resource& other);
- // Returns true if the given resource is invalid or uninitialized.
+ /// This functions determines if this resource is invalid or
+ /// uninitialized.
+ ///
+ /// @return true if this resource is invalid or uninitialized.
bool is_null() const { return !pp_resource_; }
PP_Resource pp_resource() const { return pp_resource_; }
- // Releases ownership of the PP_Resource and returns it to the caller.
- // Note the the reference count on the resource is unchanged and the caller
- // needs to release the resource.
+ /// This function releases ownership of this resource and returns it to the
+ /// caller.
+ ///
+ /// Note that the reference count on the resource is unchanged and the caller
+ /// needs to release the resource.
+ ///
+ /// @return The detached PP_Resource.
PP_Resource detach();
protected:
- // This constructor is used when we've gotten a PP_Resource as a return value
- // that we need to addref.
+ /// A constructor used when a PP_Resource is provided as a return value
+ /// whose reference count we need to increment.
+ ///
+ /// @param[in] resource A PP_Resource.
explicit Resource(PP_Resource resource);
- // Called by derived class' constructors to initialize this Resource with
- // a PP_Resource that has already been AddRef'ed. It also assumes this object
- // has no current resource.
- //
- // The intended usage is that the derived class constructor will call the
- // default Resource constructor, then make a call to create a resource. It
- // then wants to assign the new resource (which, since it was returned by the
- // browser, is already AddRef'ed).
+ /// This function is called by derived class' constructors to initialize this
+ /// Resource with a PP_Resource that has already had its reference count
+ /// incremented Core::AddRefResource. It also assumes this object has no
dmichael (off chromium) 2011/06/07 20:45:26 'incremented' -> 'incremented by'
jond 2011/06/08 16:30:12 Done.
+ /// current resource.
+ ///
+ /// The intended usage is that the derived class constructor will call the
+ /// default Resource constructor, then make a call to create a resource. It
+ /// then wants to assign the new resource (which, since it was returned by the
+ /// browser, is already AddRef'ed).
+ ///
+ /// @param[in] resource A PP_Resource.
void PassRefFromConstructor(PP_Resource resource);
private:
« no previous file with comments | « ppapi/cpp/core.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698