| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROMECAST_BROWSER_CAST_NETWORK_DELEGATE_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_NETWORK_DELEGATE_H_ |
| 6 #define CHROMECAST_BROWSER_CAST_NETWORK_DELEGATE_H_ | 6 #define CHROMECAST_BROWSER_CAST_NETWORK_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/base/network_delegate_impl.h" | 9 #include "net/base/network_delegate_impl.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 class SSLPrivateKey; |
| 12 class X509Certificate; | 13 class X509Certificate; |
| 13 } | 14 } |
| 14 | 15 |
| 15 namespace chromecast { | 16 namespace chromecast { |
| 16 namespace shell { | 17 namespace shell { |
| 17 | 18 |
| 18 class CastNetworkDelegate : public net::NetworkDelegateImpl { | 19 class CastNetworkDelegate : public net::NetworkDelegateImpl { |
| 19 public: | 20 public: |
| 20 static CastNetworkDelegate* Create(); | 21 static CastNetworkDelegate* Create(); |
| 21 static net::X509Certificate* DeviceCert(); | 22 static net::X509Certificate* DeviceCert(); |
| 23 static net::SSLPrivateKey* DeviceKey(); |
| 22 | 24 |
| 23 CastNetworkDelegate(); | 25 CastNetworkDelegate(); |
| 24 ~CastNetworkDelegate() override; | 26 ~CastNetworkDelegate() override; |
| 25 | 27 |
| 26 virtual void Initialize(bool use_sync_signing) = 0; | 28 virtual void Initialize(bool use_sync_signing) = 0; |
| 27 | 29 |
| 28 virtual bool IsWhitelisted(const GURL& gurl, int render_process_id, | 30 virtual bool IsWhitelisted(const GURL& gurl, int render_process_id, |
| 29 bool for_device_auth) const = 0; | 31 bool for_device_auth) const = 0; |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 // net::NetworkDelegate implementation: | 34 // net::NetworkDelegate implementation: |
| 33 bool OnCanAccessFile(const net::URLRequest& request, | 35 bool OnCanAccessFile(const net::URLRequest& request, |
| 34 const base::FilePath& original_path, | 36 const base::FilePath& original_path, |
| 35 const base::FilePath& absolute_path) const override; | 37 const base::FilePath& absolute_path) const override; |
| 36 | 38 |
| 37 DISALLOW_COPY_AND_ASSIGN(CastNetworkDelegate); | 39 DISALLOW_COPY_AND_ASSIGN(CastNetworkDelegate); |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 } // namespace shell | 42 } // namespace shell |
| 41 } // namespace chromecast | 43 } // namespace chromecast |
| 42 | 44 |
| 43 #endif // CHROMECAST_BROWSER_CAST_NETWORK_DELEGATE_H_ | 45 #endif // CHROMECAST_BROWSER_CAST_NETWORK_DELEGATE_H_ |
| OLD | NEW |