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

Unified Diff: Source/core/loader/ImageLoader.cpp

Issue 1153233002: Correctly set ScriptState in the image loader microtask (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« Source/core/dom/Microtask.h ('K') | « Source/core/dom/Microtask.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/ImageLoader.cpp
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp
index 8e1adb8b22220c11f5fdf34f0fcf5e54bd36932e..9090bbae6c03a325b0579be0f2fedb67968f7ab6 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -23,6 +23,8 @@
#include "core/loader/ImageLoader.h"
#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/V8Binding.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
#include "core/dom/IncrementLoadEventDelayCount.h"
@@ -90,6 +92,11 @@ public:
virtual void run() override
{
if (m_loader) {
+ v8::Local<v8::Context> context = toV8Context(&m_loader->element()->document(), DOMWrapperWorld::mainWorld());
+ if (context.IsEmpty())
+ return;
+
+ ScriptState::Scope scope(ScriptState::from(context));
#if ENABLE(OILPAN)
// Oilpan: this WebThread::Task microtask may run after the
// loader has been GCed, but not yet lazily swept & finalized
« Source/core/dom/Microtask.h ('K') | « Source/core/dom/Microtask.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698