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

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: Eliminate usage of RPH observer Created 4 years, 4 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 2016 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 "content/public/browser/browser_thread.h"
9 #include "net/base/host_port_pair.h"
10
11 namespace data_reduction_proxy {
12
13 // static
14 void DataReductionProxyHostImpl::Create(
15 base::WeakPtr<DataReductionProxyConfig> config,
16 mojom::DataReductionProxyHostRequest request) {
17 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
18 if (config) {
19 new data_reduction_proxy::DataReductionProxyHostImpl(config,
dcheng 2016/08/26 19:16:20 Does it make sense to actually call Create if |con
leonhsl(Using Gerrit) 2016/08/29 06:12:06 If we do not AddInterface, ERROR log "Failed to lo
20 std::move(request));
21 }
22 }
23
24 DataReductionProxyHostImpl::DataReductionProxyHostImpl(
25 base::WeakPtr<DataReductionProxyConfig> config,
26 mojom::DataReductionProxyHostRequest request)
27 : config_(config), binding_(this, std::move(request)) {}
28
29 DataReductionProxyHostImpl::~DataReductionProxyHostImpl() {}
30
31 void DataReductionProxyHostImpl::IsDataReductionProxy(
32 const net::HostPortPair& proxy_server,
33 const IsDataReductionProxyCallback& callback) {
34 if (!config_) {
35 callback.Run(false);
36 return;
37 }
38
39 callback.Run(config_->IsDataReductionProxy(proxy_server, nullptr));
40 }
41
42 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698