summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/plugins/ppapi/ppb_buffer_impl.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/ppb_buffer_impl.cc b/webkit/plugins/ppapi/ppb_buffer_impl.cc
index 8db5d55..b834e41 100644
--- a/webkit/plugins/ppapi/ppb_buffer_impl.cc
+++ b/webkit/plugins/ppapi/ppb_buffer_impl.cc
@@ -89,6 +89,7 @@ PPB_Buffer_Impl* PPB_Buffer_Impl::AsPPB_Buffer_Impl() {
bool PPB_Buffer_Impl::Init(uint32_t size) {
if (size == 0 || !instance())
return false;
+ size_ = size;
shared_memory_.reset(
instance()->delegate()->CreateAnonymousSharedMemory(size));
return shared_memory_.get() != NULL;
@@ -99,7 +100,9 @@ void PPB_Buffer_Impl::Describe(uint32_t* size_in_bytes) const {
}
void* PPB_Buffer_Impl::Map() {
- if (!shared_memory_.get() || !shared_memory_->Map(size_))
+ DCHECK(size_);
+ DCHECK(shared_memory_.get());
+ if (!shared_memory_->Map(size_))
return NULL;
return shared_memory_->memory();
}