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

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

Issue 2161193003: Use __func__ instead of __FUNCTION__. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format hates WebKit style 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file defines helper methods used to schedule files for deletion 5 // This file defines helper methods used to schedule files for deletion
6 // on next reboot. The code here is heavily borrowed and simplified from 6 // on next reboot. The code here is heavily borrowed and simplified from
7 // http://code.google.com/p/omaha/source/browse/trunk/common/file.cc and 7 // http://code.google.com/p/omaha/source/browse/trunk/common/file.cc and
8 // http://code.google.com/p/omaha/source/browse/trunk/common/utils.cc 8 // http://code.google.com/p/omaha/source/browse/trunk/common/utils.cc
9 // 9 //
10 // This implementation really is not fast, so do not use it where that will 10 // This implementation really is not fast, so do not use it where that will
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 *write_pointer = L'\0'; // Explicitly set the final null char. 244 *write_pointer = L'\0'; // Explicitly set the final null char.
245 DCHECK(++write_pointer == end_pointer); 245 DCHECK(++write_pointer == end_pointer);
246 } 246 }
247 247
248 base::FilePath GetShortPathName(const base::FilePath& path) { 248 base::FilePath GetShortPathName(const base::FilePath& path) {
249 std::wstring short_path; 249 std::wstring short_path;
250 DWORD length = GetShortPathName(path.value().c_str(), 250 DWORD length = GetShortPathName(path.value().c_str(),
251 base::WriteInto(&short_path, MAX_PATH), 251 base::WriteInto(&short_path, MAX_PATH),
252 MAX_PATH); 252 MAX_PATH);
253 DWORD last_error = ::GetLastError(); 253 DWORD last_error = ::GetLastError();
grt (UTC plus 2) 2016/07/20 06:18:51 while you're at it, could you remove this line and
Peter Kasting 2016/07/20 06:27:22 That last error value is used in the condition for
grt (UTC plus 2) 2016/07/20 06:32:47 Ah, I just saw "DLOG" and "gle" in the message wit
Peter Kasting 2016/07/20 06:35:51 I don't mind at all, it's more convenient than doi
254 DLOG_IF(WARNING, length == 0 && last_error != ERROR_PATH_NOT_FOUND) 254 DLOG_IF(WARNING, length == 0 && last_error != ERROR_PATH_NOT_FOUND)
255 << __FUNCTION__ << " gle=" << last_error; 255 << __func__ << " gle=" << last_error;
256 if ((length == 0) || (length > MAX_PATH)) { 256 if ((length == 0) || (length > MAX_PATH)) {
257 // GetShortPathName fails if the path is no longer present or cannot be 257 // GetShortPathName fails if the path is no longer present or cannot be
258 // put in the size buffer provided. Instead of returning an empty string, 258 // put in the size buffer provided. Instead of returning an empty string,
259 // just return the original string. This will serve our purposes. 259 // just return the original string. This will serve our purposes.
260 return path; 260 return path;
261 } 261 }
262 262
263 short_path.resize(length); 263 short_path.resize(length);
264 return base::FilePath(short_path); 264 return base::FilePath(short_path);
265 } 265 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 ERROR_SUCCESS); 397 ERROR_SUCCESS);
398 } 398 }
399 std::vector<char> buffer; 399 std::vector<char> buffer;
400 StringArrayToMultiSZBytes(strings_to_keep, &buffer); 400 StringArrayToMultiSZBytes(strings_to_keep, &buffer);
401 DCHECK_GT(buffer.size(), 0U); 401 DCHECK_GT(buffer.size(), 0U);
402 if (buffer.empty()) 402 if (buffer.empty())
403 return false; 403 return false;
404 return (session_manager_key.WriteValue(kPendingFileRenameOps, &buffer[0], 404 return (session_manager_key.WriteValue(kPendingFileRenameOps, &buffer[0],
405 buffer.size(), REG_MULTI_SZ) == ERROR_SUCCESS); 405 buffer.size(), REG_MULTI_SZ) == ERROR_SUCCESS);
406 } 406 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698