OLD | NEW |
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/browser/time_zone_monitor.h" | 5 #include "content/browser/time_zone_monitor.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // this format was encountered, but this is not necessary: when loading a | 144 // this format was encountered, but this is not necessary: when loading a |
145 // time zone specification in this way, glibc does not reload the file when | 145 // time zone specification in this way, glibc does not reload the file when |
146 // it changes, so it's pointless to respond to a notification that it has | 146 // it changes, so it's pointless to respond to a notification that it has |
147 // changed. | 147 // changed. |
148 if (!getenv("TZ")) { | 148 if (!getenv("TZ")) { |
149 impl_ = new TimeZoneMonitorLinuxImpl(this); | 149 impl_ = new TimeZoneMonitorLinuxImpl(this); |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 TimeZoneMonitorLinux::~TimeZoneMonitorLinux() { | 153 TimeZoneMonitorLinux::~TimeZoneMonitorLinux() { |
154 if (impl_) { | 154 if (impl_.get()) { |
155 impl_->StopWatching(); | 155 impl_->StopWatching(); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 // static | 159 // static |
160 scoped_ptr<TimeZoneMonitor> TimeZoneMonitor::Create() { | 160 scoped_ptr<TimeZoneMonitor> TimeZoneMonitor::Create() { |
161 return scoped_ptr<TimeZoneMonitor>(new TimeZoneMonitorLinux()); | 161 return scoped_ptr<TimeZoneMonitor>(new TimeZoneMonitorLinux()); |
162 } | 162 } |
163 | 163 |
164 } // namespace content | 164 } // namespace content |
165 | 165 |
166 #endif // !OS_CHROMEOS | 166 #endif // !OS_CHROMEOS |
OLD | NEW |