summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/V8Utilities.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-08-11 14:44:44 +0100
committerBen Murdoch <benm@google.com>2010-08-12 19:15:41 +0100
commitdd8bb3de4f353a81954234999f1fea748aee2ea9 (patch)
tree729b52bf09294f0d6c67cd5ea80aee1b727b7bd8 /WebCore/bindings/v8/V8Utilities.cpp
parentf3d41ba51d86bf719c7a65ab5297aea3c17e2d98 (diff)
downloadexternal_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.zip
external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.gz
external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.bz2
Merge WebKit at r65072 : Initial merge by git.
Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585
Diffstat (limited to 'WebCore/bindings/v8/V8Utilities.cpp')
-rw-r--r--WebCore/bindings/v8/V8Utilities.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/WebCore/bindings/v8/V8Utilities.cpp b/WebCore/bindings/v8/V8Utilities.cpp
index f780218..2e5cf8b 100644
--- a/WebCore/bindings/v8/V8Utilities.cpp
+++ b/WebCore/bindings/v8/V8Utilities.cpp
@@ -38,6 +38,8 @@
#include "ScriptExecutionContext.h"
#include "ScriptState.h"
#include "V8Binding.h"
+#include "V8BindingDOMWindow.h" // FIXME: remove when completeURL moves
+#include "V8BindingState.h"
#include "V8Proxy.h"
#include "WorkerContext.h"
#include "WorkerContextExecutionProxy.h"
@@ -92,41 +94,25 @@ void transferHiddenDependency(v8::Handle<v8::Object> object,
if (!newValue->IsNull() && !newValue->IsUndefined())
createHiddenDependency(object, newValue, cacheIndex);
}
-
bool processingUserGesture()
{
- Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
- return frame && frame->script()->processingUserGesture();
+ return V8BindingState::Only()->processingUserGesture();
}
Frame* callingOrEnteredFrame()
{
- Frame* frame = V8Proxy::retrieveFrameForCallingContext();
- if (!frame) {
- // Unfortunately, when processing script from a plug-in, we might not
- // have a calling context. In those cases, we fall back to the
- // entered context for security checks.
- // FIXME: We need a better API for retrieving frames that abstracts
- // away this concern.
- frame = V8Proxy::retrieveFrameForEnteredContext();
- }
- return frame;
+ return V8BindingState::Only()->getActiveFrame();
}
bool shouldAllowNavigation(Frame* frame)
{
- Frame* callingOrEntered = callingOrEnteredFrame();
- return callingOrEntered && callingOrEntered->loader()->shouldAllowNavigation(frame);
+ return V8BindingSecurity::shouldAllowNavigation(V8BindingState::Only(), frame);
}
KURL completeURL(const String& relativeURL)
{
- // For histoical reasons, we need to complete the URL using the dynamic frame.
- Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
- if (!frame)
- return KURL();
- return frame->loader()->completeURL(relativeURL);
+ return V8BindingDOMWindow::completeURL(V8BindingState::Only(), relativeURL);
}
void navigateIfAllowed(Frame* frame, const KURL& url, bool lockHistory, bool lockBackForwardList)