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

Side by Side Diff: ppapi/cpp/dev/buffer_dev.cc

Issue 5539001: Remove all the swap() stuff in the PPAPI C++ wrappers.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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
« no previous file with comments | « ppapi/cpp/dev/buffer_dev.h ('k') | ppapi/cpp/dev/directory_entry_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/buffer_dev.h ('k') | ppapi/cpp/dev/directory_entry_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698