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

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

Issue 1233043003: 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, false)) { 31 if (base::EndsWith(dll_name, kDelaySuffix,
32 base::CompareCase::INSENSITIVE_ASCII)) {
32 // Trim the "-delay.dll" suffix from the string. 33 // Trim the "-delay.dll" suffix from the string.
33 dll_name.resize(dll_name.length() - (sizeof(kDelaySuffix) - 1)); 34 dll_name.resize(dll_name.length() - (sizeof(kDelaySuffix) - 1));
34 dll_name.append(".dll"); 35 dll_name.append(".dll");
35 36
36 return reinterpret_cast<FARPROC>(::LoadLibraryA(dll_name.c_str())); 37 return reinterpret_cast<FARPROC>(::LoadLibraryA(dll_name.c_str()));
37 } 38 }
38 39
39 return NULL; 40 return NULL;
40 } 41 }
41 42
(...skipping 29 matching lines...) Expand all
71 72
72 default: 73 default:
73 NOTREACHED() << "Impossible delay load notification."; 74 NOTREACHED() << "Impossible delay load notification.";
74 break; 75 break;
75 } 76 }
76 77
77 // Returning NULL causes the delay load machinery to perform default 78 // Returning NULL causes the delay load machinery to perform default
78 // processing for this notification. 79 // processing for this notification.
79 return NULL; 80 return NULL;
80 } 81 }
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