Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_h ost_impl.h" | |
| 6 | |
| 7 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig.h" | |
| 8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" | |
| 9 #include "content/public/browser/browser_thread.h" | |
| 10 #include "net/base/host_port_pair.h" | |
| 11 | |
| 12 namespace data_reduction_proxy { | |
| 13 | |
| 14 // static | |
| 15 void DataReductionProxyHostImpl::Create( | |
| 16 DataReductionProxySettings* settings, | |
| 17 mojom::DataReductionProxyHostRequest request) { | |
| 18 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | |
| 19 new data_reduction_proxy::DataReductionProxyHostImpl(settings, | |
| 20 std::move(request)); | |
| 21 } | |
| 22 | |
| 23 DataReductionProxyHostImpl::DataReductionProxyHostImpl( | |
| 24 DataReductionProxySettings* settings, | |
| 25 mojom::DataReductionProxyHostRequest request) | |
| 26 : config_(nullptr), binding_(this, std::move(request)) { | |
| 27 if (settings) | |
| 28 config_ = settings->Config(); | |
|
Sam McNally
2016/06/20 04:57:26
DataReductionProxySettings can only be used on the
leonhsl(Using Gerrit)
2016/06/20 10:51:51
Oh yes, we can pass settings->Config() instead of
leonhsl(Using Gerrit)
2016/06/23 07:16:37
Done.
| |
| 29 } | |
| 30 | |
| 31 DataReductionProxyHostImpl::~DataReductionProxyHostImpl() {} | |
| 32 | |
| 33 void DataReductionProxyHostImpl::IsDataReductionProxy( | |
| 34 const net::HostPortPair& proxy_server, | |
| 35 const IsDataReductionProxyCallback& callback) { | |
| 36 if (!config_) { | |
| 37 callback.Run(false); | |
| 38 return; | |
| 39 } | |
| 40 | |
| 41 callback.Run(config_->IsDataReductionProxy(proxy_server, nullptr)); | |
| 42 } | |
| 43 | |
| 44 } // namespace data_reduction_proxy | |
| OLD | NEW |