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

Side by Side Diff: components/data_reduction_proxy/content/browser/data_reduction_proxy_host_impl.cc

Issue 2063683002: Migrate components/data_reduction_proxy to Mojo interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and move AddService call into RegisterRenderProcessMojoServices() Created 4 years, 6 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698