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

Side by Side Diff: chrome/common/net/notifier/base/time.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 "chrome/browser/sync/notifier/base/time.h" 5 #include "chrome/common/net/notifier/base/time.h"
6 6
7 #include <string> 7 #include <string>
8 #include <time.h> 8 #include <time.h>
9 9
10 #include "chrome/browser/sync/notifier/base/utils.h" 10 #include "chrome/common/net/notifier/base/utils.h"
11 #include "talk/base/common.h" 11 #include "talk/base/common.h"
12 #include "talk/base/logging.h" 12 #include "talk/base/logging.h"
13 13
14 namespace notifier { 14 namespace notifier {
15 15
16 char* GetLocalTimeAsString() { 16 char* GetLocalTimeAsString() {
17 time64 long_time = GetCurrent100NSTime(); 17 time64 long_time = GetCurrent100NSTime();
18 struct tm now; 18 struct tm now;
19 Time64ToTm(long_time, &now); 19 Time64ToTm(long_time, &now);
20 char* time_string = asctime(&now); 20 char* time_string = asctime(&now);
21 if (time_string) { 21 if (time_string) {
22 int time_len = strlen(time_string); 22 int time_len = strlen(time_string);
23 if (time_len > 0) { 23 if (time_len > 0) {
24 time_string[time_len - 1] = 0; // trim off terminating \n. 24 time_string[time_len - 1] = 0; // trim off terminating \n.
25 } 25 }
26 } 26 }
27 return time_string; 27 return time_string;
28 } 28 }
29 29
30 } // namespace notifier 30 } // namespace notifier
OLDNEW
« no previous file with comments | « chrome/common/net/notifier/base/time.h ('k') | chrome/common/net/notifier/base/time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698