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

Unified Diff: Source/bindings/core/v8/PrivateScriptRunner.cpp

Issue 654583003: Use the Document rather than the Frame's execution context to install JS-based marquee elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 2 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
Index: Source/bindings/core/v8/PrivateScriptRunner.cpp
diff --git a/Source/bindings/core/v8/PrivateScriptRunner.cpp b/Source/bindings/core/v8/PrivateScriptRunner.cpp
index 4b4343aa370ba91785c5250d35c63d564fa965b5..b8314f9c6215d8492aa93de8cf5d25ea4b0a7b8b 100644
--- a/Source/bindings/core/v8/PrivateScriptRunner.cpp
+++ b/Source/bindings/core/v8/PrivateScriptRunner.cpp
@@ -14,6 +14,7 @@
#ifndef NDEBUG
#include "core/PrivateScriptSourcesForTesting.h"
#endif
+#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "platform/PlatformResourceLoader.h"
@@ -170,12 +171,10 @@ static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Handle<v8::Ob
}
}
-v8::Handle<v8::Value> PrivateScriptRunner::installClassIfNeeded(LocalFrame* frame, String className)
+v8::Handle<v8::Value> PrivateScriptRunner::installClassIfNeeded(Document* document, String className)
adamk 2014/10/22 17:38:45 Asking for a Document here is odd, there are likel
{
- if (!frame)
- return v8::Handle<v8::Value>();
- v8::HandleScope handleScope(toIsolate(frame));
- v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld());
+ v8::HandleScope handleScope(toIsolate(document));
+ v8::Handle<v8::Context> context = toV8Context(document->executionContext(), DOMWrapperWorld::privateScriptIsolatedWorld());
adamk 2014/10/22 17:38:45 This is pretty magical-looking. I had to go read t
Hajime Morrita 2014/10/22 17:46:22 I think the function is an leftover of my failed a
adamk 2014/10/22 17:51:35 And yet it can (and does in this case) sometimes r
if (context.IsEmpty())
return v8::Handle<v8::Value>();
haraken 2014/10/20 23:47:54 Won't your CL hit this branch and just return an e
rhogan 2014/10/21 17:32:30 No, document->executionContext() isn't empty AFAIC
ScriptState* scriptState = ScriptState::from(context);

Powered by Google App Engine
This is Rietveld 408576698