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

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 6532037: Merge 75305 - Switch from wcsftime to GetDateFormat to avoid crash in setup.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/src/
Patch Set: Created 9 years, 10 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
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 switch (status) { 233 switch (status) {
234 case installer::FIRST_INSTALL_SUCCESS: 234 case installer::FIRST_INSTALL_SUCCESS:
235 case installer::INSTALL_REPAIRED: 235 case installer::INSTALL_REPAIRED:
236 case installer::NEW_VERSION_UPDATED: 236 case installer::NEW_VERSION_UPDATED:
237 case installer::IN_USE_UPDATED: 237 case installer::IN_USE_UPDATED:
238 return 0; 238 return 0;
239 default: 239 default:
240 return status; 240 return status;
241 } 241 }
242 } 242 }
243
244 std::wstring InstallUtil::GetCurrentDate() {
245 static const wchar_t kDateFormat[] = L"yyyyMMdd";
246 wchar_t date_str[arraysize(kDateFormat)] = {0};
247 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat,
248 date_str, arraysize(date_str));
249 if (len) {
250 --len; // Subtract terminating \0.
251 } else {
252 PLOG(DFATAL) << "GetDateFormat";
253 }
254
255 return std::wstring(date_str, len);
256 }
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698