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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2897533002: Make ImageObserver::AsyncLoadCompleted() called asynchronously (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 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/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 8c34ea90b7adca781799ab40528b5f1a96055a91..5af059e5e22570913c9fcf0067604eace2dbdf95 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -30,6 +30,7 @@
#include "core/animation/DocumentAnimations.h"
#include "core/animation/DocumentTimeline.h"
#include "core/dom/NodeTraversal.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/FlatTreeTraversal.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -640,8 +641,15 @@ void SVGImage::LoadCompleted() {
case kWaitingForAsyncLoadCompletion:
load_state_ = kLoadCompleted;
- if (GetImageObserver())
- GetImageObserver()->AsyncLoadCompleted(this);
+ if (GetImageObserver()) {
+ TaskRunnerHelper::Get(TaskType::kDOMManipulation,
fs 2017/05/19 09:06:49 Since this is a task posted on a task runner belon
hiroshige 2017/05/19 20:28:52 This is because - The frame etc. of the "client/in
+ ToLocalFrame(page_->MainFrame())->GetDocument())
kouhei (in TOK) 2017/05/19 05:20:54 ->GetDocument() not needed. TaskRunnerHelper::Get
hiroshige 2017/05/19 20:28:52 Done.
+ ->PostTask(
+ BLINK_FROM_HERE,
+ WTF::Bind(&ImageObserver::AsyncLoadCompleted,
+ WeakPersistent<ImageObserver>(GetImageObserver()),
yhirano 2017/05/19 06:55:29 Why weak?
hiroshige 2017/05/19 20:28:52 I think Persistent will also work well here. I mad
+ RefPtr<SVGImage>(this)));
+ }
break;
case kDataChangedNotStarted:
« 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