proxy_config_monitor.patch 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Thu, 18 Oct 2018 17:07:12 -0700
  4. Subject: proxy_config_monitor.patch
  5. Allow monitoring proxy config changes for a pref service.
  6. diff --git a/chrome/browser/net/proxy_config_monitor.cc b/chrome/browser/net/proxy_config_monitor.cc
  7. index c9281f7abfbdeaa4f0d9fe3c199b34fcb5acaf2c..10c008a225d7f88bc2cc39ae0a84580f8ef10a7d 100644
  8. --- a/chrome/browser/net/proxy_config_monitor.cc
  9. +++ b/chrome/browser/net/proxy_config_monitor.cc
  10. @@ -11,7 +11,9 @@
  11. #include "build/chromeos_buildflags.h"
  12. #include "chrome/browser/browser_process.h"
  13. #include "chrome/browser/net/proxy_service_factory.h"
  14. +#if 0
  15. #include "chrome/browser/profiles/profile.h"
  16. +#endif
  17. #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
  18. #include "content/public/browser/browser_thread.h"
  19. #include "mojo/public/cpp/bindings/pending_remote.h"
  20. @@ -21,12 +23,13 @@
  21. #include "chrome/browser/ash/profiles/profile_helper.h"
  22. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  23. -#if BUILDFLAG(ENABLE_EXTENSIONS)
  24. +#if 0
  25. #include "chrome/browser/extensions/api/proxy/proxy_api.h"
  26. #endif
  27. using content::BrowserThread;
  28. +#if 0
  29. ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) {
  30. DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  31. DCHECK(profile);
  32. @@ -57,6 +60,7 @@ ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) {
  33. proxy_config_service_->AddObserver(this);
  34. }
  35. +#endif
  36. ProxyConfigMonitor::ProxyConfigMonitor(PrefService* local_state) {
  37. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
  38. @@ -136,9 +140,11 @@ void ProxyConfigMonitor::OnLazyProxyConfigPoll() {
  39. void ProxyConfigMonitor::OnPACScriptError(int32_t line_number,
  40. const std::string& details) {
  41. DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  42. +#if 0
  43. extensions::ProxyEventRouter::GetInstance()->OnPACScriptError(
  44. g_browser_process->extension_event_router_forwarder(), profile_,
  45. line_number, base::UTF8ToUTF16(details));
  46. +#endif
  47. }
  48. void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
  49. @@ -152,9 +158,10 @@ void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
  50. // controlled.
  51. return;
  52. }
  53. -
  54. +#if 0
  55. extensions::ProxyEventRouter::GetInstance()->OnProxyError(
  56. g_browser_process->extension_event_router_forwarder(), profile_,
  57. net_error);
  58. +#endif
  59. }
  60. #endif
  61. diff --git a/chrome/browser/net/proxy_config_monitor.h b/chrome/browser/net/proxy_config_monitor.h
  62. index c808604a9b586eb5524a10b7561987e5b29747ea..68980ce4bf50d6bde5329f6d45209be86d878769 100644
  63. --- a/chrome/browser/net/proxy_config_monitor.h
  64. +++ b/chrome/browser/net/proxy_config_monitor.h
  65. @@ -40,11 +40,12 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer,
  66. {
  67. public:
  68. +#if 0
  69. // Creates a ProxyConfigMonitor that gets proxy settings from |profile| and
  70. // watches for changes. The created ProxyConfigMonitor must be destroyed
  71. // before |profile|.
  72. explicit ProxyConfigMonitor(Profile* profile);
  73. -
  74. +#endif
  75. // Creates a ProxyConfigMonitor that gets proxy settings from the
  76. // |local_state|, for use with NetworkContexts not
  77. // associated with a profile. Must be destroyed before |local_state|.
  78. @@ -94,7 +95,7 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer,
  79. #if BUILDFLAG(ENABLE_EXTENSIONS)
  80. mojo::ReceiverSet<network::mojom::ProxyErrorClient> error_receiver_set_;
  81. - raw_ptr<Profile> profile_ = nullptr;
  82. + // raw_ptr<Profile> profile_ = nullptr;
  83. #endif
  84. };