| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/common/media_galleries/picasa_types.h" | 5 #include "chrome/common/media_galleries/picasa_types.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "chrome/common/media_galleries/pmp_constants.h" | 10 #include "chrome/common/media_galleries/pmp_constants.h" |
| 9 | 11 |
| 10 namespace picasa { | 12 namespace picasa { |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 base::File OpenFile(const base::FilePath& directory_path, | 16 base::File OpenFile(const base::FilePath& directory_path, |
| 15 const std::string& suffix) { | 17 const std::string& suffix) { |
| 16 base::FilePath path = directory_path.Append(base::FilePath::FromUTF8Unsafe( | 18 base::FilePath path = directory_path.Append(base::FilePath::FromUTF8Unsafe( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 date_file(OpenColumnFile(directory_path, "date")), | 61 date_file(OpenColumnFile(directory_path, "date")), |
| 60 filename_file(OpenColumnFile(directory_path, "filename")), | 62 filename_file(OpenColumnFile(directory_path, "filename")), |
| 61 name_file(OpenColumnFile(directory_path, "name")), | 63 name_file(OpenColumnFile(directory_path, "name")), |
| 62 token_file(OpenColumnFile(directory_path, "token")), | 64 token_file(OpenColumnFile(directory_path, "token")), |
| 63 uid_file(OpenColumnFile(directory_path, "uid")) { | 65 uid_file(OpenColumnFile(directory_path, "uid")) { |
| 64 } | 66 } |
| 65 | 67 |
| 66 AlbumTableFiles::~AlbumTableFiles() { | 68 AlbumTableFiles::~AlbumTableFiles() { |
| 67 } | 69 } |
| 68 | 70 |
| 69 AlbumTableFiles::AlbumTableFiles(RValue other) | 71 AlbumTableFiles::AlbumTableFiles(AlbumTableFiles&& other) |
| 70 : indicator_file(other.object->indicator_file.Pass()), | 72 : indicator_file(std::move(other.indicator_file)), |
| 71 category_file(other.object->category_file.Pass()), | 73 category_file(std::move(other.category_file)), |
| 72 date_file(other.object->date_file.Pass()), | 74 date_file(std::move(other.date_file)), |
| 73 filename_file(other.object->filename_file.Pass()), | 75 filename_file(std::move(other.filename_file)), |
| 74 name_file(other.object->name_file.Pass()), | 76 name_file(std::move(other.name_file)), |
| 75 token_file(other.object->token_file.Pass()), | 77 token_file(std::move(other.token_file)), |
| 76 uid_file(other.object->uid_file.Pass()) { | 78 uid_file(std::move(other.uid_file)) {} |
| 77 } | |
| 78 | 79 |
| 79 AlbumTableFiles& AlbumTableFiles::operator=(RValue other) { | 80 AlbumTableFiles& AlbumTableFiles::operator=(AlbumTableFiles&& other) { |
| 80 if (this != other.object) { | 81 indicator_file = std::move(other.indicator_file); |
| 81 indicator_file = other.object->indicator_file.Pass(); | 82 category_file = std::move(other.category_file); |
| 82 category_file = other.object->category_file.Pass(); | 83 date_file = std::move(other.date_file); |
| 83 date_file = other.object->date_file.Pass(); | 84 filename_file = std::move(other.filename_file); |
| 84 filename_file = other.object->filename_file.Pass(); | 85 name_file = std::move(other.name_file); |
| 85 name_file = other.object->name_file.Pass(); | 86 token_file = std::move(other.token_file); |
| 86 token_file = other.object->token_file.Pass(); | 87 uid_file = std::move(other.uid_file); |
| 87 uid_file = other.object->uid_file.Pass(); | |
| 88 } | |
| 89 return *this; | 88 return *this; |
| 90 } | 89 } |
| 91 | 90 |
| 92 AlbumTableFilesForTransit::AlbumTableFilesForTransit() | 91 AlbumTableFilesForTransit::AlbumTableFilesForTransit() |
| 93 : indicator_file(IPC::InvalidPlatformFileForTransit()), | 92 : indicator_file(IPC::InvalidPlatformFileForTransit()), |
| 94 category_file(IPC::InvalidPlatformFileForTransit()), | 93 category_file(IPC::InvalidPlatformFileForTransit()), |
| 95 date_file(IPC::InvalidPlatformFileForTransit()), | 94 date_file(IPC::InvalidPlatformFileForTransit()), |
| 96 filename_file(IPC::InvalidPlatformFileForTransit()), | 95 filename_file(IPC::InvalidPlatformFileForTransit()), |
| 97 name_file(IPC::InvalidPlatformFileForTransit()), | 96 name_file(IPC::InvalidPlatformFileForTransit()), |
| 98 token_file(IPC::InvalidPlatformFileForTransit()), | 97 token_file(IPC::InvalidPlatformFileForTransit()), |
| 99 uid_file(IPC::InvalidPlatformFileForTransit()) { | 98 uid_file(IPC::InvalidPlatformFileForTransit()) { |
| 100 } | 99 } |
| 101 | 100 |
| 102 } // namespace picasa | 101 } // namespace picasa |
| OLD | NEW |