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

Side by Side Diff: third_party/WebKit/Source/platform/threading/BindForMojo.h

Issue 1753543002: PaymentRequest Mojo bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface
Patch Set: haraken@'s + esprehn@'s comments Created 4 years, 8 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 #ifndef BindForMojo_h
6 #define BindForMojo_h
7
8 #include "base/bind.h"
9 #include "mojo/public/cpp/bindings/callback.h"
10
11 // This file provides limited access to base::Bind() function. base::Bind()
12 // could be dangerous if it's used across threads, so we don't want to allow
13 // general use of base::Bind().
14 // See also "platform/ThreadSafeFunctional.h".
15
16 namespace blink {
17
18 // Binds an instance of a class to its member function. Does not bind anything
19 // else.
20 template <typename Class, typename ReturnType, typename... Args>
21 mojo::Callback<ReturnType(Args...)>
22 sameThreadBindForMojo(ReturnType (Class::*method)(Args...), Class* instance)
23 {
24 return base::Bind(method, base::Unretained(instance));
25 }
26
27 } // namespace blink
28
29 #endif // BindForMojo_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698