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

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: Lei Zhang's comments 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 bool conversion_success =
29 base::Time::FromLocalExploded(kPmpVariantTimeEpoch, &out_time);
30 DCHECK(conversion_success);
31
32 return out_time + variant_delta;
28 } 33 }
29 34
30 } // namespace 35 } // namespace
31 36
32 PicasaAlbumTableReader::PicasaAlbumTableReader(AlbumTableFiles table_files) 37 PicasaAlbumTableReader::PicasaAlbumTableReader(AlbumTableFiles table_files)
33 : table_files_(std::move(table_files)), initialized_(false) {} 38 : table_files_(std::move(table_files)), initialized_(false) {}
34 39
35 PicasaAlbumTableReader::~PicasaAlbumTableReader() { 40 PicasaAlbumTableReader::~PicasaAlbumTableReader() {
36 } 41 }
37 42
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 113
109 folders_.push_back(AlbumInfo(name, timestamp, uid, path)); 114 folders_.push_back(AlbumInfo(name, timestamp, uid, path));
110 } 115 }
111 } 116 }
112 117
113 initialized_ = true; 118 initialized_ = true;
114 return true; 119 return true;
115 } 120 }
116 121
117 } // namespace picasa 122 } // namespace picasa
OLDNEW
« no previous file with comments | « chrome/installer/gcapi/gcapi_omaha_experiment.cc ('k') | ios/chrome/browser/ui/webui/history/browsing_history_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698