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

Side by Side Diff: content/child/file_info_util.cc

Issue 884413002: Upgrade Blink to milliseconds-based last modified filetimes, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/file_info_util.h" 5 #include "content/child/file_info_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebFileInfo.h" 8 #include "third_party/WebKit/public/platform/WebFileInfo.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 void FileInfoToWebFileInfo(const base::File::Info& file_info, 12 void FileInfoToWebFileInfo(const base::File::Info& file_info,
13 blink::WebFileInfo* web_file_info) { 13 blink::WebFileInfo* web_file_info) {
14 DCHECK(web_file_info); 14 DCHECK(web_file_info);
15 // WebKit now expects NaN as uninitialized/null Date. 15 // WebKit now expects NaN as uninitialized/null Date.
16 if (file_info.last_modified.is_null()) 16 if (file_info.last_modified.is_null()) {
17 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); 17 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN();
18 else 18 web_file_info->modificationTimeMS =
19 std::numeric_limits<double>::quiet_NaN();
20 } else {
19 web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); 21 web_file_info->modificationTime = file_info.last_modified.ToDoubleT();
22 web_file_info->modificationTimeMS = file_info.last_modified.ToJsTime();
23 }
20 web_file_info->length = file_info.size; 24 web_file_info->length = file_info.size;
21 if (file_info.is_directory) 25 if (file_info.is_directory)
22 web_file_info->type = blink::WebFileInfo::TypeDirectory; 26 web_file_info->type = blink::WebFileInfo::TypeDirectory;
23 else 27 else
24 web_file_info->type = blink::WebFileInfo::TypeFile; 28 web_file_info->type = blink::WebFileInfo::TypeFile;
25 } 29 }
26 30
27 static_assert(std::numeric_limits<double>::has_quiet_NaN, 31 static_assert(std::numeric_limits<double>::has_quiet_NaN,
28 "should have quiet NaN"); 32 "should have quiet NaN");
29 33
30 } // namespace content 34 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698