OLD | NEW |
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 "ppapi/cpp/dev/buffer_dev.h" | 5 #include "ppapi/cpp/dev/buffer_dev.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_buffer_dev.h" | 7 #include "ppapi/c/dev/ppb_buffer_dev.h" |
8 #include "ppapi/cpp/instance_handle.h" | 8 #include "ppapi/cpp/instance_handle.h" |
9 #include "ppapi/cpp/module.h" | 9 #include "ppapi/cpp/module.h" |
10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 get_interface<PPB_Buffer_Dev>()->Unmap(pp_resource()); | 52 get_interface<PPB_Buffer_Dev>()->Unmap(pp_resource()); |
53 } | 53 } |
54 | 54 |
55 Buffer_Dev& Buffer_Dev::operator=(const Buffer_Dev& rhs) { | 55 Buffer_Dev& Buffer_Dev::operator=(const Buffer_Dev& rhs) { |
56 Resource::operator=(rhs); | 56 Resource::operator=(rhs); |
57 Init(); | 57 Init(); |
58 return *this; | 58 return *this; |
59 } | 59 } |
60 | 60 |
61 void Buffer_Dev::Init() { | 61 void Buffer_Dev::Init() { |
62 if (!get_interface<PPB_Buffer_Dev>()->Describe(pp_resource(), &size_) || | 62 if (get_interface<PPB_Buffer_Dev>()->Describe(pp_resource(), &size_)) { |
63 !(data_ = get_interface<PPB_Buffer_Dev>()->Map(pp_resource()))) { | 63 data_ = get_interface<PPB_Buffer_Dev>()->Map(pp_resource()); |
64 data_ = NULL; | 64 if (data_) |
65 size_ = 0; | 65 return; |
66 } | 66 } |
| 67 data_ = NULL; |
| 68 size_ = 0; |
67 } | 69 } |
68 | 70 |
69 } // namespace pp | 71 } // namespace pp |
OLD | NEW |