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

Side by Side Diff: extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.cc

Issue 2851173004: Eliminate bind callback that doesn't take a BindSourceInfo parameter. (Closed)
Patch Set: . Created 3 years, 7 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "extensions/browser/api/display_source/wifi_display/wifi_display_sessio n_service_impl.h" 5 #include "extensions/browser/api/display_source/wifi_display/wifi_display_sessio n_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 #include "extensions/browser/api/display_source/display_source_connection_delega te_factory.h" 10 #include "extensions/browser/api/display_source/display_source_connection_delega te_factory.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 WiFiDisplaySessionServiceImpl::~WiFiDisplaySessionServiceImpl() { 32 WiFiDisplaySessionServiceImpl::~WiFiDisplaySessionServiceImpl() {
33 delegate_->RemoveObserver(this); 33 delegate_->RemoveObserver(this);
34 Disconnect(); 34 Disconnect();
35 } 35 }
36 36
37 // static 37 // static
38 void WiFiDisplaySessionServiceImpl::BindToRequest( 38 void WiFiDisplaySessionServiceImpl::BindToRequest(
39 content::BrowserContext* browser_context, 39 content::BrowserContext* browser_context,
40 mojo::InterfaceRequest<WiFiDisplaySessionService> request) { 40 const service_manager::BindSourceInfo& source_info,
41 WiFiDisplaySessionServiceRequest request) {
41 DisplaySourceConnectionDelegate* delegate = 42 DisplaySourceConnectionDelegate* delegate =
42 DisplaySourceConnectionDelegateFactory::GetForBrowserContext( 43 DisplaySourceConnectionDelegateFactory::GetForBrowserContext(
43 browser_context); 44 browser_context);
44 CHECK(delegate); 45 CHECK(delegate);
45 auto* impl = new WiFiDisplaySessionServiceImpl(delegate); 46 auto* impl = new WiFiDisplaySessionServiceImpl(delegate);
46 impl->binding_ = 47 impl->binding_ =
47 mojo::MakeStrongBinding(base::WrapUnique(impl), std::move(request)); 48 mojo::MakeStrongBinding(base::WrapUnique(impl), std::move(request));
48 } 49 }
49 50
50 void WiFiDisplaySessionServiceImpl::SetClient( 51 void WiFiDisplaySessionServiceImpl::SetClient(
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 DCHECK(client_); 199 DCHECK(client_);
199 client_->OnDisconnectRequestHandled(false, message); 200 client_->OnDisconnectRequestHandled(false, message);
200 } 201 }
201 202
202 void WiFiDisplaySessionServiceImpl::OnClientConnectionError() { 203 void WiFiDisplaySessionServiceImpl::OnClientConnectionError() {
203 DLOG(ERROR) << "IPC connection error"; 204 DLOG(ERROR) << "IPC connection error";
204 binding_->Close(); 205 binding_->Close();
205 } 206 }
206 207
207 } // namespace extensions 208 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698