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

Side by Side Diff: chrome/utility/media_galleries/picasa_album_table_reader.cc

Issue 2111103002: Make callers of FromUTC(Local)Exploded in chrome/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: modified comments in code Created 4 years, 5 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
OLDNEW
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/utility/media_galleries/picasa_album_table_reader.h" 5 #include "chrome/utility/media_galleries/picasa_album_table_reader.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/common/media_galleries/pmp_constants.h" 15 #include "chrome/common/media_galleries/pmp_constants.h"
16 #include "chrome/utility/media_galleries/pmp_column_reader.h" 16 #include "chrome/utility/media_galleries/pmp_column_reader.h"
17 17
18 namespace picasa { 18 namespace picasa {
19 19
20 namespace { 20 namespace {
21 21
22 // |variant_time| is specified as the number of days from Dec 30, 1899. 22 // |variant_time| is specified as the number of days from Dec 30, 1899.
23 base::Time TimeFromMicrosoftVariantTime(double variant_time) { 23 base::Time TimeFromMicrosoftVariantTime(double variant_time) {
24 base::TimeDelta variant_delta = base::TimeDelta::FromMicroseconds( 24 base::TimeDelta variant_delta = base::TimeDelta::FromMicroseconds(
25 static_cast<int64_t>(variant_time * base::Time::kMicrosecondsPerDay)); 25 static_cast<int64_t>(variant_time * base::Time::kMicrosecondsPerDay));
26 26
27 return base::Time::FromLocalExploded(kPmpVariantTimeEpoch) + variant_delta; 27 base::Time out_time;
28 if (!base::Time::FromLocalExploded(kPmpVariantTimeEpoch, &out_time)) {
Lei Zhang 2016/07/06 17:44:30 Isn't |kPmpVariantTimeEpoch| also a known to be go
maksims (do not use this acc) 2016/07/07 05:48:14 Done.
29 // TODO(maksims): implement error handling.
30 // We might just return |out_time|, which is Time(0).
31 NOTIMPLEMENTED();
32 return out_time;
33 }
34
35 return out_time + variant_delta;
28 } 36 }
29 37
30 } // namespace 38 } // namespace
31 39
32 PicasaAlbumTableReader::PicasaAlbumTableReader(AlbumTableFiles table_files) 40 PicasaAlbumTableReader::PicasaAlbumTableReader(AlbumTableFiles table_files)
33 : table_files_(std::move(table_files)), initialized_(false) {} 41 : table_files_(std::move(table_files)), initialized_(false) {}
34 42
35 PicasaAlbumTableReader::~PicasaAlbumTableReader() { 43 PicasaAlbumTableReader::~PicasaAlbumTableReader() {
36 } 44 }
37 45
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 116
109 folders_.push_back(AlbumInfo(name, timestamp, uid, path)); 117 folders_.push_back(AlbumInfo(name, timestamp, uid, path));
110 } 118 }
111 } 119 }
112 120
113 initialized_ = true; 121 initialized_ = true;
114 return true; 122 return true;
115 } 123 }
116 124
117 } // namespace picasa 125 } // namespace picasa
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698