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

Side by Side Diff: webkit/plugins/ppapi/ppb_buffer_impl.cc

Issue 7082036: Convert more interfaces to the new thunk system. (Closed) Base URL: svn://chrome-svn/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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" 5 #include "webkit/plugins/ppapi/ppb_buffer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 23 matching lines...) Expand all
34 scoped_refptr<PPB_Buffer_Impl> buffer(new PPB_Buffer_Impl(instance)); 34 scoped_refptr<PPB_Buffer_Impl> buffer(new PPB_Buffer_Impl(instance));
35 if (!buffer->Init(size)) 35 if (!buffer->Init(size))
36 return 0; 36 return 0;
37 return buffer->GetReference(); 37 return buffer->GetReference();
38 } 38 }
39 39
40 PPB_Buffer_Impl* PPB_Buffer_Impl::AsPPB_Buffer_Impl() { 40 PPB_Buffer_Impl* PPB_Buffer_Impl::AsPPB_Buffer_Impl() {
41 return this; 41 return this;
42 } 42 }
43 43
44 PPB_Buffer_API* PPB_Buffer_Impl::AsBuffer_API() { 44 PPB_Buffer_API* PPB_Buffer_Impl::AsPPB_Buffer_API() {
45 return this; 45 return this;
46 } 46 }
47 47
48 bool PPB_Buffer_Impl::Init(uint32_t size) { 48 bool PPB_Buffer_Impl::Init(uint32_t size) {
49 if (size == 0 || !instance()) 49 if (size == 0 || !instance())
50 return false; 50 return false;
51 size_ = size; 51 size_ = size;
52 shared_memory_.reset( 52 shared_memory_.reset(
53 instance()->delegate()->CreateAnonymousSharedMemory(size)); 53 instance()->delegate()->CreateAnonymousSharedMemory(size));
54 return shared_memory_.get() != NULL; 54 return shared_memory_.get() != NULL;
(...skipping 26 matching lines...) Expand all
81 api->Describe(&size_); 81 api->Describe(&size_);
82 } 82 }
83 83
84 BufferAutoMapper::~BufferAutoMapper() { 84 BufferAutoMapper::~BufferAutoMapper() {
85 if (needs_unmap_) 85 if (needs_unmap_)
86 api_->Unmap(); 86 api_->Unmap();
87 } 87 }
88 88
89 } // namespace ppapi 89 } // namespace ppapi
90 } // namespace webkit 90 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698