summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/resource.h
diff options
context:
space:
mode:
authorjond@google.com <jond@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 18:58:51 +0000
committerjond@google.com <jond@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 18:58:51 +0000
commitd2c3d1ae6fd030b2d1ccca11bfd58404172e3805 (patch)
tree13265ab2e19842a3b5cd2dbd2d77219a1e72ae8e /ppapi/cpp/resource.h
parent9749550b77e75523ed3bbedfb52b34536799e280 (diff)
downloadchromium_src-d2c3d1ae6fd030b2d1ccca11bfd58404172e3805.zip
chromium_src-d2c3d1ae6fd030b2d1ccca11bfd58404172e3805.tar.gz
chromium_src-d2c3d1ae6fd030b2d1ccca11bfd58404172e3805.tar.bz2
New documentation for resource.h, core.h, and common.h
Review URL: http://codereview.chromium.org/7054060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/resource.h')
-rw-r--r--ppapi/cpp/resource.h58
1 files changed, 42 insertions, 16 deletions
diff --git a/ppapi/cpp/resource.h b/ppapi/cpp/resource.h
index c59b37d..8d22254 100644
--- a/ppapi/cpp/resource.h
+++ b/ppapi/cpp/resource.h
@@ -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.
@@ -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 by Core::AddRefResource. 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).
+ ///
+ /// @param[in] resource A PP_Resource.
void PassRefFromConstructor(PP_Resource resource);
private: