| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 8 #include "ppapi/cpp/instance.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 22 matching lines...) Expand all Loading... |
| 33 PassRefFromConstructor(buffer_f->Create(Module::Get()->pp_module(), size)); | 33 PassRefFromConstructor(buffer_f->Create(Module::Get()->pp_module(), size)); |
| 34 if (!buffer_f->Describe(pp_resource(), &size_) || | 34 if (!buffer_f->Describe(pp_resource(), &size_) || |
| 35 !(data_ = buffer_f->Map(pp_resource()))) | 35 !(data_ = buffer_f->Map(pp_resource()))) |
| 36 *this = Buffer_Dev(); | 36 *this = Buffer_Dev(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 Buffer_Dev::~Buffer_Dev() { | 39 Buffer_Dev::~Buffer_Dev() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 Buffer_Dev& Buffer_Dev::operator=(const Buffer_Dev& other) { | 42 Buffer_Dev& Buffer_Dev::operator=(const Buffer_Dev& other) { |
| 43 Buffer_Dev copy(other); | 43 Resource::operator=(other); |
| 44 swap(copy); | 44 size_ = other.size_; |
| 45 data_ = other.data_; |
| 45 return *this; | 46 return *this; |
| 46 } | 47 } |
| 47 | 48 |
| 48 void Buffer_Dev::swap(Buffer_Dev& other) { | |
| 49 Resource::swap(other); | |
| 50 std::swap(size_, other.size_); | |
| 51 std::swap(data_, other.data_); | |
| 52 } | |
| 53 | |
| 54 } // namespace pp | 49 } // namespace pp |
| 55 | 50 |
| OLD | NEW |