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

Unified Diff: webrtc/base/proxydetect.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/base/proxydetect.cc
diff --git a/webrtc/base/proxydetect.cc b/webrtc/base/proxydetect.cc
index b0fa30488a1eed3f770bf78afe6fe242b50447a5..bc3c73e1ac06fb324e64ecd17b585496c469935a 100644
--- a/webrtc/base/proxydetect.cc
+++ b/webrtc/base/proxydetect.cc
@@ -155,8 +155,8 @@ extern "C" {
#define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY 0
#define WINHTTP_ACCESS_TYPE_NO_PROXY 1
#define WINHTTP_ACCESS_TYPE_NAMED_PROXY 3
-#define WINHTTP_NO_PROXY_NAME NULL
-#define WINHTTP_NO_PROXY_BYPASS NULL
+#define WINHTTP_NO_PROXY_NAME nullptr
+#define WINHTTP_NO_PROXY_BYPASS nullptr
#endif // _TRY_WINHTTP
@@ -401,7 +401,7 @@ bool GetFirefoxProfilePath(Pathname* path) {
return result;
#else
char* user_home = getenv("HOME");
- if (user_home == NULL) {
+ if (user_home == nullptr) {
return false;
}
path->SetFolder(std::string(user_home));
@@ -412,7 +412,7 @@ bool GetFirefoxProfilePath(Pathname* path) {
}
bool GetDefaultFirefoxProfile(Pathname* profile_path) {
- RTC_DCHECK(NULL != profile_path);
+ RTC_DCHECK(nullptr != profile_path);
Pathname path;
if (!GetFirefoxProfilePath(&path)) {
return false;
@@ -623,7 +623,7 @@ bool IsDefaultBrowserFirefox() {
DWORD size, type;
bool success = false;
- result = RegQueryValueEx(key, L"", 0, &type, NULL, &size);
+ result = RegQueryValueEx(key, L"", 0, &type, nullptr, &size);
if (result == ERROR_SUCCESS && type == REG_SZ) {
wchar_t* value = new wchar_t[size+1];
BYTE* buffer = reinterpret_cast<BYTE*>(value);
@@ -636,7 +636,7 @@ bool IsDefaultBrowserFirefox() {
for (size_t i = 0; i < size; ++i) {
value[i] = tolowercase(value[i]);
}
- success = (NULL != strstr(value, L"firefox.exe"));
+ success = (nullptr != strstr(value, L"firefox.exe"));
}
delete[] value;
}
@@ -647,7 +647,7 @@ bool IsDefaultBrowserFirefox() {
bool GetWinHttpProxySettings(const char* url, ProxyInfo* proxy) {
HMODULE winhttp_handle = LoadLibrary(L"winhttp.dll");
- if (winhttp_handle == NULL) {
+ if (winhttp_handle == nullptr) {
LOG(LS_ERROR) << "Failed to load winhttp.dll.";
return false;
}
@@ -699,7 +699,7 @@ bool WinHttpAutoDetectProxyForUrl(const char* agent, const char* url,
Url<char> purl(url);
bool success = true;
HMODULE winhttp_handle = LoadLibrary(L"winhttp.dll");
- if (winhttp_handle == NULL) {
+ if (winhttp_handle == nullptr) {
LOG(LS_ERROR) << "Failed to load winhttp.dll.";
return false;
}
@@ -961,7 +961,7 @@ bool p_getProxyInfoForTypeFromDictWithKeys(ProxyInfo* proxy,
std::string hostname;
int port;
- if ((proxyDict != NULL) &&
+ if ((proxyDict != nullptr) &&
(CFGetTypeID(proxyDict) == CFDictionaryGetTypeID())) {
// CoreFoundation stuff that we'll have to get from
// the dictionaries and interpret or convert into more usable formats.
@@ -1077,9 +1077,8 @@ bool p_putPasswordInProxyInfo(ProxyInfo* proxy) {
if (result) {
LOG(LS_INFO) << "trying to get proxy username/password";
SecKeychainSearchRef sref;
- oss = SecKeychainSearchCreateFromAttributes(NULL,
- kSecInternetPasswordItemClass,
- &attrList, &sref);
+ oss = SecKeychainSearchCreateFromAttributes(
+ nullptr, kSecInternetPasswordItemClass, &attrList, &sref);
if (0 == oss) {
LOG(LS_INFO) << "SecKeychainSearchCreateFromAttributes was good";
// Get the first item, if there is one.
@@ -1099,12 +1098,8 @@ bool p_putPasswordInProxyInfo(ProxyInfo* proxy) {
attribsToGet.tag = &tag;
attribsToGet.format = &format;
- OSStatus copyres = SecKeychainItemCopyAttributesAndData(iref,
- &attribsToGet,
- NULL,
- &localList,
- &length,
- &data);
+ OSStatus copyres = SecKeychainItemCopyAttributesAndData(
+ iref, &attribsToGet, nullptr, &localList, &length, &data);
if (0 == copyres) {
LOG(LS_INFO) << "...and we can pull it out.";
// now, we know from experimentation (sadly not from docs)
@@ -1155,10 +1150,10 @@ bool p_putPasswordInProxyInfo(ProxyInfo* proxy) {
bool GetMacProxySettings(ProxyInfo* proxy) {
// based on the Apple Technical Q&A QA1234
// http://developer.apple.com/qa/qa2001/qa1234.html
- CFDictionaryRef proxyDict = SCDynamicStoreCopyProxies(NULL);
+ CFDictionaryRef proxyDict = SCDynamicStoreCopyProxies(nullptr);
bool result = false;
- if (proxyDict != NULL) {
+ if (proxyDict != nullptr) {
// sending it off to another function makes it easier to unit test
// since we can make our own dictionary to hand to that function.
result = GetMacProxySettingsFromDictionary(proxy, proxyDict);

Powered by Google App Engine
This is Rietveld 408576698