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

Side by Side Diff: chrome/app/delay_load_hook_win.cc

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/test/test_suite.cc ('k') | chrome/browser/banners/app_banner_data_fetcher.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/app/delay_load_hook_win.h" 5 #include "chrome/app/delay_load_hook_win.h"
6 6
7 #include <DelayIMP.h> 7 #include <DelayIMP.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 10 matching lines...) Expand all
21 21
22 22
23 namespace { 23 namespace {
24 24
25 FARPROC OnPreLoadLibrary(DelayLoadInfo* info) { 25 FARPROC OnPreLoadLibrary(DelayLoadInfo* info) {
26 // If the DLL name ends with "-delay.dll", this call is about one of our 26 // If the DLL name ends with "-delay.dll", this call is about one of our
27 // custom import libraries. In this case we need to snip the suffix off, 27 // custom import libraries. In this case we need to snip the suffix off,
28 // and bind to the real DLL. 28 // and bind to the real DLL.
29 std::string dll_name(info->szDll); 29 std::string dll_name(info->szDll);
30 const char kDelaySuffix[] = "-delay.dll"; 30 const char kDelaySuffix[] = "-delay.dll";
31 if (base::EndsWith(dll_name, kDelaySuffix, 31 if (base::EndsWith(dll_name, kDelaySuffix, false)) {
32 base::CompareCase::INSENSITIVE_ASCII)) {
33 // Trim the "-delay.dll" suffix from the string. 32 // Trim the "-delay.dll" suffix from the string.
34 dll_name.resize(dll_name.length() - (sizeof(kDelaySuffix) - 1)); 33 dll_name.resize(dll_name.length() - (sizeof(kDelaySuffix) - 1));
35 dll_name.append(".dll"); 34 dll_name.append(".dll");
36 35
37 return reinterpret_cast<FARPROC>(::LoadLibraryA(dll_name.c_str())); 36 return reinterpret_cast<FARPROC>(::LoadLibraryA(dll_name.c_str()));
38 } 37 }
39 38
40 return NULL; 39 return NULL;
41 } 40 }
42 41
(...skipping 29 matching lines...) Expand all
72 71
73 default: 72 default:
74 NOTREACHED() << "Impossible delay load notification."; 73 NOTREACHED() << "Impossible delay load notification.";
75 break; 74 break;
76 } 75 }
77 76
78 // Returning NULL causes the delay load machinery to perform default 77 // Returning NULL causes the delay load machinery to perform default
79 // processing for this notification. 78 // processing for this notification.
80 return NULL; 79 return NULL;
81 } 80 }
OLDNEW
« no previous file with comments | « base/test/test_suite.cc ('k') | chrome/browser/banners/app_banner_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698