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

Side by Side Diff: services/service_manager/public/cpp/lib/callback_binder.cc

Issue 2860943002: Flatten interface_binder.h and callback_binder.h (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
« no previous file with comments | « services/service_manager/public/cpp/lib/callback_binder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/service_manager/public/cpp/lib/callback_binder.h"
6
7 namespace service_manager {
8 namespace internal {
9
10 GenericCallbackBinder::GenericCallbackBinder(
11 const BindCallback& callback,
12 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
13 : callback_(callback), task_runner_(task_runner) {}
14
15 GenericCallbackBinder::~GenericCallbackBinder() {}
16
17 void GenericCallbackBinder::BindInterface(
18 const BindSourceInfo& source_info,
19 const std::string& interface_name,
20 mojo::ScopedMessagePipeHandle handle) {
21 if (task_runner_) {
22 task_runner_->PostTask(
23 FROM_HERE, base::Bind(&GenericCallbackBinder::RunCallback, callback_,
24 base::Passed(&handle)));
25 return;
26 }
27 RunCallback(callback_, std::move(handle));
28 }
29
30 // static
31 void GenericCallbackBinder::RunCallback(const BindCallback& callback,
32 mojo::ScopedMessagePipeHandle handle) {
33 callback.Run(std::move(handle));
34 }
35
36 } // namespace internal
37 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/public/cpp/lib/callback_binder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698