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

Unified Diff: ppapi/cpp/array_output.h

Issue 9728001: Make the file chooser use PP_ArrayOutput (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/c/trusted/ppb_file_chooser_trusted.h ('k') | ppapi/cpp/completion_callback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/array_output.h
diff --git a/ppapi/cpp/array_output.h b/ppapi/cpp/array_output.h
index 4441386bfd555978e4254e8dff1edb48cdf71e05..708150757d67dcc4ff354756759b72dfdebdf6bd 100644
--- a/ppapi/cpp/array_output.h
+++ b/ppapi/cpp/array_output.h
@@ -47,7 +47,7 @@ class ArrayOutputAdapterBase {
}
virtual ~ArrayOutputAdapterBase() {}
- PP_ArrayOutput* pp_array_output() { return &pp_array_output_; }
+ const PP_ArrayOutput& pp_array_output() { return pp_array_output_; }
protected:
virtual void* GetDataBuffer(uint32_t element_count,
@@ -92,6 +92,8 @@ class ArrayOutputAdapter : public ArrayOutputAdapterBase {
// ArrayOutputAdapterBase implementation.
virtual void* GetDataBuffer(uint32_t element_count, uint32_t element_size) {
+ if (element_count == 0)
+ return NULL;
PP_DCHECK(element_size == sizeof(T));
if (element_size != sizeof(T))
return NULL;
@@ -140,6 +142,8 @@ class ResourceArrayOutputAdapter : public ArrayOutputAdapterBase {
// ArrayOutputAdapterBase implementation.
virtual void* GetDataBuffer(uint32_t element_count,
uint32_t element_size) {
+ if (element_count == 0)
+ return NULL;
PP_DCHECK(element_size == sizeof(PP_Resource));
if (element_size != sizeof(PP_Resource))
return NULL;
« no previous file with comments | « ppapi/c/trusted/ppb_file_chooser_trusted.h ('k') | ppapi/cpp/completion_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698