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

Side by Side Diff: third_party/WebKit/Source/platform/base/Bind.h

Issue 1538803002: Migrates battery_status from content/renderer/ to WebKit/platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/platform/DEPS ('k') | third_party/WebKit/Source/platform/base/DEPS » ('j') | 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 #ifndef Bind_h
6 #define Bind_h
7
8 #include "base/bind.h"
9
10 // This file provides limited access to base::Bind() function. base::Bind()
11 // could be dangerous if it's used across threads, so we don't want to allow
12 // general use of base::Bind().
13 // See also "platform/ThreadSafeFunctional.h".
14
15 namespace blink {
16
17 // Binds an instance of a class to its member function. Does not bind anything
18 // else.
19 template<typename Class, typename ReturnType, typename... Args>
20 auto bindInstanceToMethod(ReturnType (Class::*method)(Args...), Class* instance)
dcheng 2016/01/27 02:50:01 Out of curiosity, why not base::Callback<ReturnTyp
Yuki 2016/01/27 04:29:45 The return type of base::Bind is template <typena
tzik 2016/01/27 05:17:26 The result of the complex template is just to drop
Yuki 2016/01/27 05:31:08 Ah, I see. Good to know. Thanks.
21 -> decltype(base::Bind(method, base::Unretained(instance)))
22 {
23 return base::Bind(method, base::Unretained(instance));
24 }
25
26 } // namespace blink
27
28 #endif // Bind_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/DEPS ('k') | third_party/WebKit/Source/platform/base/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698