[go: nahoru, domu]

Reland "Rename ProxyChain and ProxyResolver Apple classes"

This reverts commit a7a7732586d82b8b2ca2bb5b5c0254d3f6eae9b6.

Reason for revert: Reverted https://chromium-review.googlesource.com/c/chromium/src/+/5190661.

Original change's description:
> Revert "Rename ProxyChain and ProxyResolver Apple classes"
>
> This reverts commit 782da25142cbbe236eafa5d216911072d34655f0.
>
> Reason for revert: Blocker for reverting https://chromium-review.googlesource.com/c/chromium/src/+/5190661
>
> Original change's description:
> > Rename ProxyChain and ProxyResolver Apple classes
> >
> > ProxyChain and ProxyResolver are used both by macOS and iOS, so this
> > follows the naming convention to change to something more suggestive.
> >
> > Bug: None
> > Change-Id: I1f6bb242d22e5fe57bc036d6504a6ddcca0e4164
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5198057
> > Reviewed-by: Adam Langley <agl@chromium.org>
> > Reviewed-by: Paul Jensen <pauljensen@chromium.org>
> > Commit-Queue: Tiago Vignatti <tvignatti@igalia.com>
> > Cr-Commit-Position: refs/heads/main@{#1247698}
>
> Bug: None
> Change-Id: Ie730f53e449617aec63c1983ee3f4692ba6b3e16
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5202120
> Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Tsuyoshi Horo <horo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1247868}

Bug: None
Change-Id: I4940dda287c5cfea6215152c6c5c1e9d8a8dab95
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5202538
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1248457}
diff --git a/net/BUILD.gn b/net/BUILD.gn
index d38049b..7eff5300 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1204,10 +1204,10 @@
       "base/platform_mime_util_mac.mm",
       "cert/x509_util_apple.cc",
       "cert/x509_util_apple.h",
-      "proxy_resolution/proxy_chain_util_mac.cc",
-      "proxy_resolution/proxy_chain_util_mac.h",
-      "proxy_resolution/proxy_resolver_mac.cc",
-      "proxy_resolution/proxy_resolver_mac.h",
+      "proxy_resolution/proxy_chain_util_apple.cc",
+      "proxy_resolution/proxy_chain_util_apple.h",
+      "proxy_resolution/proxy_resolver_apple.cc",
+      "proxy_resolution/proxy_resolver_apple.h",
     ]
   }
 
@@ -2803,7 +2803,7 @@
   if (is_apple) {
     sources += [
       "cert/x509_util_apple_unittest.cc",
-      "proxy_resolution/proxy_chain_util_mac_unittest.cc",
+      "proxy_resolution/proxy_chain_util_apple_unittest.cc",
     ]
   }
 
diff --git a/net/proxy_resolution/configured_proxy_resolution_service.cc b/net/proxy_resolution/configured_proxy_resolution_service.cc
index 7468d23f..124d5af7 100644
--- a/net/proxy_resolution/configured_proxy_resolution_service.cc
+++ b/net/proxy_resolution/configured_proxy_resolution_service.cc
@@ -45,10 +45,8 @@
 
 #if BUILDFLAG(IS_WIN)
 #include "net/proxy_resolution/win/proxy_resolver_winhttp.h"
-#elif BUILDFLAG(IS_IOS)
-#include "net/proxy_resolution/proxy_resolver_mac.h"
-#elif BUILDFLAG(IS_MAC)
-#include "net/proxy_resolution/proxy_resolver_mac.h"
+#elif BUILDFLAG(IS_APPLE)
+#include "net/proxy_resolution/proxy_resolver_apple.h"
 #endif
 
 using base::TimeTicks;
@@ -229,7 +227,7 @@
 #if BUILDFLAG(IS_WIN)
     return std::make_unique<ProxyResolverFactoryWinHttp>();
 #elif BUILDFLAG(IS_APPLE)
-    return std::make_unique<ProxyResolverFactoryMac>();
+    return std::make_unique<ProxyResolverFactoryApple>();
 #else
     NOTREACHED();
     return nullptr;
diff --git a/net/proxy_resolution/proxy_chain_util_mac.cc b/net/proxy_resolution/proxy_chain_util_apple.cc
similarity index 97%
rename from net/proxy_resolution/proxy_chain_util_mac.cc
rename to net/proxy_resolution/proxy_chain_util_apple.cc
index a675cd00..ac6ef3ea 100644
--- a/net/proxy_resolution/proxy_chain_util_mac.cc
+++ b/net/proxy_resolution/proxy_chain_util_apple.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "net/proxy_resolution/proxy_chain_util_mac.h"
+#include "net/proxy_resolution/proxy_chain_util_apple.h"
 
 #include <CFNetwork/CFProxySupport.h>
 #include <CoreFoundation/CoreFoundation.h>
diff --git a/net/proxy_resolution/proxy_chain_util_mac.h b/net/proxy_resolution/proxy_chain_util_apple.h
similarity index 83%
rename from net/proxy_resolution/proxy_chain_util_mac.h
rename to net/proxy_resolution/proxy_chain_util_apple.h
index 3cbfe7b8..2f605c2f 100644
--- a/net/proxy_resolution/proxy_chain_util_mac.h
+++ b/net/proxy_resolution/proxy_chain_util_apple.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_MAC_H_
-#define NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_MAC_H_
+#ifndef NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_APPLE_H_
+#define NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_APPLE_H_
 
 #include <CoreFoundation/CoreFoundation.h>
 
@@ -23,4 +23,4 @@
 
 }  // namespace net
 
-#endif  // NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_MAC_H_
+#endif  // NET_PROXY_RESOLUTION_PROXY_CHAIN_UTIL_APPLE_H_
diff --git a/net/proxy_resolution/proxy_chain_util_mac_unittest.cc b/net/proxy_resolution/proxy_chain_util_apple_unittest.cc
similarity index 89%
rename from net/proxy_resolution/proxy_chain_util_mac_unittest.cc
rename to net/proxy_resolution/proxy_chain_util_apple_unittest.cc
index cb234774..fd87cfec 100644
--- a/net/proxy_resolution/proxy_chain_util_mac_unittest.cc
+++ b/net/proxy_resolution/proxy_chain_util_apple_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "net/proxy_resolution/proxy_chain_util_mac.h"
+#include "net/proxy_resolution/proxy_chain_util_apple.h"
 
 #include <CFNetwork/CFProxySupport.h>
 #include <CoreFoundation/CoreFoundation.h>
@@ -16,7 +16,7 @@
 
 // Test convert ProxyDictionary To ProxyChain with invalid inputs.
 // https://crbug.com/1478580
-TEST(ProxyChainUtilMacTest, InvalidProxyDictionaryToProxyChain) {
+TEST(ProxyChainUtilAppleTest, InvalidProxyDictionaryToProxyChain) {
   CFStringRef host_key = CFSTR("HttpHost");
   CFStringRef port_key = CFSTR("HttpPort");
   CFStringRef value = CFSTR("127.1110.0.1");
diff --git a/net/proxy_resolution/proxy_config_service_ios.cc b/net/proxy_resolution/proxy_config_service_ios.cc
index 1f777ef..31ce0ea 100644
--- a/net/proxy_resolution/proxy_config_service_ios.cc
+++ b/net/proxy_resolution/proxy_config_service_ios.cc
@@ -11,7 +11,7 @@
 #include "base/apple/scoped_cftyperef.h"
 #include "base/strings/sys_string_conversions.h"
 #include "net/base/proxy_chain.h"
-#include "net/proxy_resolution/proxy_chain_util_mac.h"
+#include "net/proxy_resolution/proxy_chain_util_apple.h"
 #include "net/proxy_resolution/proxy_config_with_annotation.h"
 
 namespace net {
diff --git a/net/proxy_resolution/proxy_config_service_mac.cc b/net/proxy_resolution/proxy_config_service_mac.cc
index c1604b6..485d2dc 100644
--- a/net/proxy_resolution/proxy_config_service_mac.cc
+++ b/net/proxy_resolution/proxy_config_service_mac.cc
@@ -18,7 +18,7 @@
 #include "base/strings/sys_string_conversions.h"
 #include "base/task/sequenced_task_runner.h"
 #include "net/base/net_errors.h"
-#include "net/proxy_resolution/proxy_chain_util_mac.h"
+#include "net/proxy_resolution/proxy_chain_util_apple.h"
 #include "net/proxy_resolution/proxy_info.h"
 
 namespace net {
diff --git a/net/proxy_resolution/proxy_resolver_mac.cc b/net/proxy_resolution/proxy_resolver_apple.cc
similarity index 94%
rename from net/proxy_resolution/proxy_resolver_mac.cc
rename to net/proxy_resolution/proxy_resolver_apple.cc
index 630f097..db8cc70 100644
--- a/net/proxy_resolution/proxy_resolver_mac.cc
+++ b/net/proxy_resolution/proxy_resolver_apple.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "net/proxy_resolution/proxy_resolver_mac.h"
+#include "net/proxy_resolution/proxy_resolver_apple.h"
 
 #include <CFNetwork/CFProxySupport.h>
 #include <CoreFoundation/CoreFoundation.h>
@@ -19,7 +19,7 @@
 #include "base/threading/thread_checker.h"
 #include "build/build_config.h"
 #include "net/base/net_errors.h"
-#include "net/proxy_resolution/proxy_chain_util_mac.h"
+#include "net/proxy_resolution/proxy_chain_util_apple.h"
 #include "net/proxy_resolution/proxy_info.h"
 #include "net/proxy_resolution/proxy_list.h"
 #include "net/proxy_resolution/proxy_resolver.h"
@@ -41,7 +41,7 @@
 
 namespace {
 
-// A lock shared by all ProxyResolverMac instances. It is used to synchronize
+// A lock shared by all ProxyResolverApple instances. It is used to synchronize
 // the events of multiple CFNetworkExecuteProxyAutoConfigurationURL run loop
 // sources. These events are:
 // 1. Adding the source to the run loop.
@@ -179,11 +179,11 @@
   observerInstance->RunLoopObserverCallBack(observer, activity);
 }
 
-#pragma mark - ProxyResolverMac
-class ProxyResolverMac : public ProxyResolver {
+#pragma mark - ProxyResolverApple
+class ProxyResolverApple : public ProxyResolver {
  public:
-  explicit ProxyResolverMac(const scoped_refptr<PacFileData>& script_data);
-  ~ProxyResolverMac() override;
+  explicit ProxyResolverApple(const scoped_refptr<PacFileData>& script_data);
+  ~ProxyResolverApple() override;
 
   // ProxyResolver methods:
   int GetProxyForURL(const GURL& url,
@@ -197,15 +197,15 @@
   const scoped_refptr<PacFileData> script_data_;
 };
 
-ProxyResolverMac::ProxyResolverMac(
+ProxyResolverApple::ProxyResolverApple(
     const scoped_refptr<PacFileData>& script_data)
     : script_data_(script_data) {}
 
-ProxyResolverMac::~ProxyResolverMac() = default;
+ProxyResolverApple::~ProxyResolverApple() = default;
 
 // Gets the proxy information for a query URL from a PAC. Implementation
 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/
-int ProxyResolverMac::GetProxyForURL(
+int ProxyResolverApple::GetProxyForURL(
     const GURL& query_url,
     const NetworkAnonymizationKey& network_anonymization_key,
     ProxyInfo* results,
@@ -265,7 +265,7 @@
     return ERR_FAILED;
 
   const CFStringRef private_runloop_mode =
-      CFSTR("org.chromium.ProxyResolverMac");
+      CFSTR("org.chromium.ProxyResolverApple");
 
   // Add the run loop observer to synchronize events of
   // CFNetworkExecuteProxyAutoConfigurationURL sources. See the definition of
@@ -347,16 +347,16 @@
 
 }  // namespace
 
-ProxyResolverFactoryMac::ProxyResolverFactoryMac()
+ProxyResolverFactoryApple::ProxyResolverFactoryApple()
     : ProxyResolverFactory(false /*expects_pac_bytes*/) {
 }
 
-int ProxyResolverFactoryMac::CreateProxyResolver(
+int ProxyResolverFactoryApple::CreateProxyResolver(
     const scoped_refptr<PacFileData>& pac_script,
     std::unique_ptr<ProxyResolver>* resolver,
     CompletionOnceCallback callback,
     std::unique_ptr<Request>* request) {
-  *resolver = std::make_unique<ProxyResolverMac>(pac_script);
+  *resolver = std::make_unique<ProxyResolverApple>(pac_script);
   return OK;
 }
 
diff --git a/net/proxy_resolution/proxy_resolver_apple.h b/net/proxy_resolution/proxy_resolver_apple.h
new file mode 100644
index 0000000..92576a8
--- /dev/null
+++ b/net/proxy_resolution/proxy_resolver_apple.h
@@ -0,0 +1,35 @@
+// Copyright 2011 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_PROXY_RESOLUTION_PROXY_RESOLVER_APPLE_H_
+#define NET_PROXY_RESOLUTION_PROXY_RESOLVER_APPLE_H_
+
+#include "base/compiler_specific.h"
+#include "net/base/completion_once_callback.h"
+#include "net/base/net_export.h"
+#include "net/proxy_resolution/proxy_resolver_factory.h"
+#include "url/gurl.h"
+
+namespace net {
+
+// Implementation of ProxyResolverFactory that uses the Apple CFProxySupport to
+// implement proxies.
+// TODO(kapishnikov): make ProxyResolverApple async as per
+// https://bugs.chromium.org/p/chromium/issues/detail?id=166387#c95
+class NET_EXPORT ProxyResolverFactoryApple : public ProxyResolverFactory {
+ public:
+  ProxyResolverFactoryApple();
+
+  ProxyResolverFactoryApple(const ProxyResolverFactoryApple&) = delete;
+  ProxyResolverFactoryApple& operator=(const ProxyResolverFactoryApple&) = delete;
+
+  int CreateProxyResolver(const scoped_refptr<PacFileData>& pac_script,
+                          std::unique_ptr<ProxyResolver>* resolver,
+                          CompletionOnceCallback callback,
+                          std::unique_ptr<Request>* request) override;
+};
+
+}  // namespace net
+
+#endif  // NET_PROXY_RESOLUTION_PROXY_RESOLVER_APPLE_H_
diff --git a/net/proxy_resolution/proxy_resolver_mac.h b/net/proxy_resolution/proxy_resolver_mac.h
deleted file mode 100644
index 819b7d32..0000000
--- a/net/proxy_resolution/proxy_resolver_mac.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2011 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_PROXY_RESOLUTION_PROXY_RESOLVER_MAC_H_
-#define NET_PROXY_RESOLUTION_PROXY_RESOLVER_MAC_H_
-
-#include "base/compiler_specific.h"
-#include "net/base/completion_once_callback.h"
-#include "net/base/net_export.h"
-#include "net/proxy_resolution/proxy_resolver_factory.h"
-#include "url/gurl.h"
-
-namespace net {
-
-// Implementation of ProxyResolverFactory that uses the Mac CFProxySupport to
-// implement proxies.
-// TODO(kapishnikov): make ProxyResolverMac async as per
-// https://bugs.chromium.org/p/chromium/issues/detail?id=166387#c95
-class NET_EXPORT ProxyResolverFactoryMac : public ProxyResolverFactory {
- public:
-  ProxyResolverFactoryMac();
-
-  ProxyResolverFactoryMac(const ProxyResolverFactoryMac&) = delete;
-  ProxyResolverFactoryMac& operator=(const ProxyResolverFactoryMac&) = delete;
-
-  int CreateProxyResolver(const scoped_refptr<PacFileData>& pac_script,
-                          std::unique_ptr<ProxyResolver>* resolver,
-                          CompletionOnceCallback callback,
-                          std::unique_ptr<Request>* request) override;
-};
-
-}  // namespace net
-
-#endif  // NET_PROXY_RESOLUTION_PROXY_RESOLVER_MAC_H_