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

Unified Diff: ppapi/cpp/dev/directory_entry_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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/dev/directory_entry_dev.h ('k') | ppapi/cpp/dev/directory_reader_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/directory_entry_dev.cc
===================================================================
--- ppapi/cpp/dev/directory_entry_dev.cc (revision 67885)
+++ ppapi/cpp/dev/directory_entry_dev.cc (working copy)
@@ -28,14 +28,12 @@
DirectoryEntry_Dev& DirectoryEntry_Dev::operator=(
const DirectoryEntry_Dev& other) {
- DirectoryEntry_Dev copy(other);
- swap(copy);
+ if (data_.file_ref)
+ Module::Get()->core()->ReleaseResource(data_.file_ref);
+ data_ = other.data_;
+ if (data_.file_ref)
+ Module::Get()->core()->AddRefResource(data_.file_ref);
return *this;
}
-void DirectoryEntry_Dev::swap(DirectoryEntry_Dev& other) {
- std::swap(data_.file_ref, other.data_.file_ref);
- std::swap(data_.file_type, other.data_.file_type);
-}
-
} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/directory_entry_dev.h ('k') | ppapi/cpp/dev/directory_reader_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698