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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2529353002: [wrapper-tracing] Avoid GC during PostMessageTimer construction (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index aad31716786f96c5a49adbea8bb9c4b5932a7395..86f2a58cdd13d15cae46cec45c18279a660a36d9 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -625,9 +625,10 @@ void LocalDOMWindow::schedulePostMessage(MessageEvent* event,
// Allowing unbounded amounts of messages to build up for a suspended context
// is problematic; consider imposing a limit or other restriction if this
// surfaces often as a problem (see crbug.com/587012).
- PostMessageTimer* timer = new PostMessageTimer(
- *this, event, std::move(target), SourceLocation::capture(source),
- UserGestureIndicator::currentToken());
+ std::unique_ptr<SourceLocation> location = SourceLocation::capture(source);
sof 2016/11/29 09:15:44 Subtle staging of allocations going on here wrt 'n
Michael Lippautz 2016/11/29 09:51:41 Sorry, for not leaving a comment. The rationale is
+ PostMessageTimer* timer =
+ new PostMessageTimer(*this, event, std::move(target), std::move(location),
+ UserGestureIndicator::currentToken());
timer->startOneShot(0, BLINK_FROM_HERE);
timer->suspendIfNeeded();
m_postMessageTimers.add(timer);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698