|
Change the return type of WTF::bind() to |OwnPtr<Function>|
Previously WTF::bind() returns |Function|, but this causes implicit temporary objects and copies of |Function|, resulting potential thread-safe issues.
This CL changes the return type of WTF::bind() to |OwnPtr<Function>|, thus removing such temporary objects and making the ownership of |Function| explicit.
- Change the return type of WTF::bind().
- Replace |const Function&| in parameter with |PassOwnPtr<Function>|.
- Replace |Function| with |OwnPtr<Function>|.
- Add |.release()| and replace |f()| with |(*f)()|.
- Other types of changes are in |callOnMainThread| and NetworkStateNotifierTest.cpp.
(|Function| appears in typedef'ed names such as Closure.)
Also this CL makes |FunctionBase| non-copyable to prevent unintended copies of |Function|.
BUG= 390851
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185348
Total comments: 10
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+146 lines, -138 lines) |
Patch |
 |
M |
Source/core/dom/ExecutionContextTask.h
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/Microtask.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/Microtask.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/canvas/CanvasRenderingContext2D.h
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/canvas/CanvasRenderingContext2D.cpp
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/parser/HTMLParserThread.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/parser/HTMLParserThread.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/loader/WorkerLoaderClientBridgeSyncHelper.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/loader/WorkerLoaderClientBridgeSyncHelper.cpp
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/page/NetworkStateNotifierTest.cpp
|
View
|
1
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/core/workers/WorkerThread.cpp
|
View
|
1
2
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
|
View
|
|
3 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/LocalFileSystem.h
|
View
|
1
2
3
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/LocalFileSystem.cpp
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/platform/PermissionCallbacks.h
|
View
|
|
2 chunks |
+7 lines, -6 lines |
0 comments
|
Download
|
 |
M |
Source/platform/PermissionCallbacks.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/platform/Task.h
|
View
|
1
2
3
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/platform/heap/HeapTest.cpp
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/platform/scheduler/Scheduler.h
|
View
|
1
2
3
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/platform/scheduler/Scheduler.cpp
|
View
|
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/web/WebEmbeddedWorkerImpl.cpp
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/web/WebSharedWorkerImpl.cpp
|
View
|
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/Functional.h
|
View
|
1
|
3 chunks |
+16 lines, -14 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/FunctionalTest.cpp
|
View
|
|
7 chunks |
+55 lines, -54 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/MainThread.h
|
View
|
1
2
3
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/MainThread.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
Total messages: 11 (3 generated)
|