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

Side by Side Diff: chrome/browser/chromeos/drive/resource_entry_conversion.cc

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/chromeos/drive/resource_entry_conversion.h" 5 #include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // in that case we need to return true to proceed. 126 // in that case we need to return true to proceed.
127 if (!input.deleted()) 127 if (!input.deleted())
128 return false; 128 return false;
129 } 129 }
130 130
131 out_entry->Swap(&converted); 131 out_entry->Swap(&converted);
132 swap(*out_parent_resource_id, parent_resource_id); 132 swap(*out_parent_resource_id, parent_resource_id);
133 return true; 133 return true;
134 } 134 }
135 135
136 void ConvertResourceEntryToPlatformFileInfo(const ResourceEntry& entry, 136 void ConvertResourceEntryToFileInfo(const ResourceEntry& entry,
137 base::PlatformFileInfo* file_info) { 137 base::File::Info* file_info) {
138 file_info->size = entry.file_info().size(); 138 file_info->size = entry.file_info().size();
139 file_info->is_directory = entry.file_info().is_directory(); 139 file_info->is_directory = entry.file_info().is_directory();
140 file_info->is_symbolic_link = entry.file_info().is_symbolic_link(); 140 file_info->is_symbolic_link = entry.file_info().is_symbolic_link();
141 file_info->last_modified = base::Time::FromInternalValue( 141 file_info->last_modified = base::Time::FromInternalValue(
142 entry.file_info().last_modified()); 142 entry.file_info().last_modified());
143 file_info->last_accessed = base::Time::FromInternalValue( 143 file_info->last_accessed = base::Time::FromInternalValue(
144 entry.file_info().last_accessed()); 144 entry.file_info().last_accessed());
145 file_info->creation_time = base::Time::FromInternalValue( 145 file_info->creation_time = base::Time::FromInternalValue(
146 entry.file_info().creation_time()); 146 entry.file_info().creation_time());
147 } 147 }
148 148
149 void SetPlatformFileInfoToResourceEntry(const base::PlatformFileInfo& file_info, 149 void SetPlatformFileInfoToResourceEntry(const base::File::Info& file_info,
150 ResourceEntry* entry) { 150 ResourceEntry* entry) {
151 PlatformFileInfoProto* entry_file_info = entry->mutable_file_info(); 151 PlatformFileInfoProto* entry_file_info = entry->mutable_file_info();
152 entry_file_info->set_size(file_info.size); 152 entry_file_info->set_size(file_info.size);
153 entry_file_info->set_is_directory(file_info.is_directory); 153 entry_file_info->set_is_directory(file_info.is_directory);
154 entry_file_info->set_is_symbolic_link(file_info.is_symbolic_link); 154 entry_file_info->set_is_symbolic_link(file_info.is_symbolic_link);
155 entry_file_info->set_last_modified(file_info.last_modified.ToInternalValue()); 155 entry_file_info->set_last_modified(file_info.last_modified.ToInternalValue());
156 entry_file_info->set_last_accessed(file_info.last_accessed.ToInternalValue()); 156 entry_file_info->set_last_accessed(file_info.last_accessed.ToInternalValue());
157 entry_file_info->set_creation_time(file_info.creation_time.ToInternalValue()); 157 entry_file_info->set_creation_time(file_info.creation_time.ToInternalValue());
158 } 158 }
159 159
160 } // namespace drive 160 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698