diff options
| author | Steve Block <steveblock@google.com> | 2009-12-17 09:55:06 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2009-12-17 09:55:06 -0800 |
| commit | b880d713c04257ca40abfef97c300afdead423b8 (patch) | |
| tree | 6982576c228bcd1a7efe98afed544d840751094c /WebCore/bindings/v8/ScriptController.cpp | |
| parent | e2e7a5c57b53f01e63a0245b4420d54b454cb373 (diff) | |
| parent | 643ca7872b450ea4efacab6188849e5aac2ba161 (diff) | |
| download | external_webkit-b880d713c04257ca40abfef97c300afdead423b8.zip external_webkit-b880d713c04257ca40abfef97c300afdead423b8.tar.gz external_webkit-b880d713c04257ca40abfef97c300afdead423b8.tar.bz2 | |
am 643ca787: Merge webkit.org at r51976 : Initial merge by git.
Merge commit '643ca7872b450ea4efacab6188849e5aac2ba161' into eclair-mr2-plus-aosp
* commit '643ca7872b450ea4efacab6188849e5aac2ba161':
Merge webkit.org at r51976 : Initial merge by git.
Diffstat (limited to 'WebCore/bindings/v8/ScriptController.cpp')
| -rw-r--r-- | WebCore/bindings/v8/ScriptController.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp index 35a2d73..5b4dbc2 100644 --- a/WebCore/bindings/v8/ScriptController.cpp +++ b/WebCore/bindings/v8/ScriptController.cpp @@ -45,18 +45,21 @@ #include "EventListener.h" #include "EventNames.h" #include "Frame.h" +#include "FrameLoaderClient.h" #include "Node.h" #include "NotImplemented.h" #include "npruntime_impl.h" #include "npruntime_priv.h" #include "NPV8Object.h" #include "ScriptSourceCode.h" -#include "Widget.h" -#include "XSSAuditor.h" - +#include "ScriptState.h" +#include "Settings.h" #include "V8Binding.h" #include "V8NPObject.h" #include "V8Proxy.h" +#include "Widget.h" +#include "XSSAuditor.h" +#include <wtf/StdLibExtras.h> namespace WebCore { @@ -295,7 +298,8 @@ bool ScriptController::haveInterpreter() const bool ScriptController::isEnabled() const { - return m_proxy->isEnabled(); + Settings* settings = m_proxy->frame()->settings(); + return m_proxy->frame()->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled() && !m_frame->loader()->isSandboxed(SandboxScripts)); } PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widget) @@ -362,6 +366,18 @@ void ScriptController::cleanupScriptObjectsForPlugin(Widget* nativeHandle) m_pluginObjects.remove(it); } +void ScriptController::getAllWorlds(Vector<DOMWrapperWorld*>& worlds) +{ + worlds.append(mainThreadNormalWorld()); +} + +ScriptState* ScriptController::mainWorldScriptState() +{ + if (!m_mainWorldScriptState) + m_mainWorldScriptState.set(new ScriptState(m_frame, V8Proxy::mainWorldContext(m_frame))); + return m_mainWorldScriptState.get(); +} + static NPObject* createNoScriptObject() { notImplemented(); @@ -440,10 +456,4 @@ void ScriptController::updateDocument() m_proxy->updateDocument(); } -// FIXME: Stub method so we compile. Currently called from FrameLoader.cpp. -DOMWrapperWorld* mainThreadNormalWorld() -{ - return 0; -} - } // namespace WebCore |
