aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkFlattenableBuffers.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-08 19:22:57 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-08 19:22:57 +0000
commit8f457e3230f1a4ce737f512ffbb5c919b8d02407 (patch)
tree1b6cb51813563c2960a4bc19562bb0c2185d89d8 /include/core/SkFlattenableBuffers.h
parent9901727f213e459901a175c119b2fad8816002a0 (diff)
Adding error checks to SkRBuffer
BUG= R=robertphillips@google.com, bsalomon@google.com, reed@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/61913002 git-svn-id: http://skia.googlecode.com/svn/trunk@12202 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkFlattenableBuffers.h')
-rw-r--r--include/core/SkFlattenableBuffers.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/core/SkFlattenableBuffers.h b/include/core/SkFlattenableBuffers.h
index 8a94bb1db2..575dec8917 100644
--- a/include/core/SkFlattenableBuffers.h
+++ b/include/core/SkFlattenableBuffers.h
@@ -144,7 +144,15 @@ public:
return SkData::NewFromMalloc(buffer, len);
}
- virtual void validate(bool isValid) {}
+ /** This function validates that the isValid input parameter is true
+ * If isValidating() is false, then true is always returned
+ * If isValidating() is true, then true is returned until validate() is called with isValid
+ * set to false. When isValid is false, an error flag will be set internally and, from that
+ * point on, validate() will return false. The error flag cannot be unset.
+ *
+ * @param isValid result of a test that is expected to be true
+ */
+ virtual bool validate(bool isValid);
private:
template <typename T> T* readFlattenableT();