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

Side by Side Diff: ppapi/cpp/dev/file_io_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/file_io_dev.h ('k') | ppapi/cpp/dev/file_ref_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/file_io_dev.h" 5 #include "ppapi/cpp/dev/file_io_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_file_io_dev.h" 7 #include "ppapi/c/dev/ppb_file_io_dev.h"
8 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h" 8 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/cpp/completion_callback.h" 10 #include "ppapi/cpp/completion_callback.h"
(...skipping 16 matching lines...) Expand all
27 if (!file_io_f) 27 if (!file_io_f)
28 return; 28 return;
29 PassRefFromConstructor(file_io_f->Create(Module::Get()->pp_module())); 29 PassRefFromConstructor(file_io_f->Create(Module::Get()->pp_module()));
30 } 30 }
31 31
32 FileIO_Dev::FileIO_Dev(const FileIO_Dev& other) 32 FileIO_Dev::FileIO_Dev(const FileIO_Dev& other)
33 : Resource(other) { 33 : Resource(other) {
34 } 34 }
35 35
36 FileIO_Dev& FileIO_Dev::operator=(const FileIO_Dev& other) { 36 FileIO_Dev& FileIO_Dev::operator=(const FileIO_Dev& other) {
37 FileIO_Dev copy(other); 37 Resource::operator=(other);
38 swap(copy);
39 return *this; 38 return *this;
40 } 39 }
41 40
42 void FileIO_Dev::swap(FileIO_Dev& other) {
43 Resource::swap(other);
44 }
45
46 int32_t FileIO_Dev::Open(const FileRef_Dev& file_ref, 41 int32_t FileIO_Dev::Open(const FileRef_Dev& file_ref,
47 int32_t open_flags, 42 int32_t open_flags,
48 const CompletionCallback& cc) { 43 const CompletionCallback& cc) {
49 if (!file_io_f) 44 if (!file_io_f)
50 return PP_ERROR_NOINTERFACE; 45 return PP_ERROR_NOINTERFACE;
51 return file_io_f->Open(pp_resource(), file_ref.pp_resource(), open_flags, 46 return file_io_f->Open(pp_resource(), file_ref.pp_resource(), open_flags,
52 cc.pp_completion_callback()); 47 cc.pp_completion_callback());
53 } 48 }
54 49
55 int32_t FileIO_Dev::Query(PP_FileInfo_Dev* result_buf, 50 int32_t FileIO_Dev::Query(PP_FileInfo_Dev* result_buf,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 121
127 int32_t FileIO_Dev::WillSetLength(int64_t length, 122 int32_t FileIO_Dev::WillSetLength(int64_t length,
128 const CompletionCallback& cc) { 123 const CompletionCallback& cc) {
129 if (!file_io_trusted_f) 124 if (!file_io_trusted_f)
130 return PP_ERROR_NOINTERFACE; 125 return PP_ERROR_NOINTERFACE;
131 return file_io_trusted_f->WillSetLength(pp_resource(), length, 126 return file_io_trusted_f->WillSetLength(pp_resource(), length,
132 cc.pp_completion_callback()); 127 cc.pp_completion_callback());
133 } 128 }
134 129
135 } // namespace pp 130 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/file_io_dev.h ('k') | ppapi/cpp/dev/file_ref_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698