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

Side by Side Diff: chrome/common/net/notifier/base/posix/time_posix.cc

Issue 1956001: Moved XMPP notifier library from chrome/browser/sync to chrome/common.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <assert.h> 5 #include <assert.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 #include <sys/time.h> 8 #include <sys/time.h>
9 9
10 #include "chrome/browser/sync/notifier/base/time.h" 10 #include "chrome/common/net/notifier/base/time.h"
11 11
12 namespace notifier { 12 namespace notifier {
13 13
14 time64 GetCurrent100NSTime() { 14 time64 GetCurrent100NSTime() {
15 struct timeval tv; 15 struct timeval tv;
16 struct timezone tz; 16 struct timezone tz;
17 17
18 gettimeofday(&tv, &tz); 18 gettimeofday(&tv, &tz);
19 19
20 time64 retval = tv.tv_sec * kSecsTo100ns; 20 time64 retval = tv.tv_sec * kSecsTo100ns;
(...skipping 10 matching lines...) Expand all
31 } 31 }
32 32
33 bool Time64ToTm(time64 t, struct tm* tm) { 33 bool Time64ToTm(time64 t, struct tm* tm) {
34 assert(tm != NULL); 34 assert(tm != NULL);
35 time_t secs = t / kSecsTo100ns; 35 time_t secs = t / kSecsTo100ns;
36 gmtime_r(&secs, tm); 36 gmtime_r(&secs, tm);
37 return true; 37 return true;
38 } 38 }
39 39
40 } // namespace notifier 40 } // namespace notifier
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698