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

Unified Diff: net/base/default_trusted_spdy_proxy_provider.h

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: net/base/default_trusted_spdy_proxy_provider.h
diff --git a/net/base/default_trusted_spdy_proxy_provider.h b/net/base/default_trusted_spdy_proxy_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..bdf9505d5b495ff283cfb3ca4c57b5a2ea18479f
--- /dev/null
+++ b/net/base/default_trusted_spdy_proxy_provider.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_DEFAULT_TRUSTED_SPDY_PROXY_PROVIDER_H_
+#define NET_BASE_DEFAULT_TRUSTED_SPDY_PROXY_PROVIDER_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
+#include "net/base/net_export.h"
+#include "net/base/trusted_spdy_proxy_provider.h"
+#include "net/proxy/proxy_server.h"
+
+namespace net {
+
+// DefaultTrustedSpdyProxyProvider implements TrustedSpdyProxyProvider, and
+// returns the proxy that is set during the time of its construction.
+class NET_EXPORT_PRIVATE DefaultTrustedSpdyProxyProvider
+ : public TrustedSpdyProxyProvider {
+ public:
+ explicit DefaultTrustedSpdyProxyProvider(
+ const ProxyServer& trusted_spdy_proxy);
+ ~DefaultTrustedSpdyProxyProvider() override;
+
+ // TrustedSpdyProxyProvider implementation:
+ void GetTrustedSpdyProxy(ProxyServer* trusted_spdy_proxy) const override;
+ base::WeakPtr<TrustedSpdyProxyProvider> GetWeakPtr() override;
+
+ private:
+ const ProxyServer trusted_spdy_proxy_;
+
+ base::ThreadChecker thread_checker_;
+
+ base::WeakPtrFactory<TrustedSpdyProxyProvider> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(DefaultTrustedSpdyProxyProvider);
+};
+
+} // namespace net
+
+#endif // NET_BASE_DEFAULT_TRUSTED_SPDY_PROXY_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698