[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c
abarth at webkit.org
abarth at webkit.org
Mon Dec 27 16:28:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 4e56433d1bb47a7bf480ff35e775de8cf4cb7432
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 22 03:10:05 2010 +0000
2010-12-21 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
Move V8 to common implementation of window.open
https://bugs.webkit.org/show_bug.cgi?id=51385
I also changed some function names to match WebKit style. There's a
bunch of code we can remove in the generic bindings now. I'll do that
in the next patch.
* bindings/generic/BindingDOMWindow.h:
(WebCore::::open):
* bindings/generic/BindingFrame.h:
(WebCore::::navigateIfAllowed):
* bindings/generic/BindingSecurity.h:
(WebCore::::canAccessWindow):
(WebCore::::allowPopUp):
(WebCore::::shouldAllowNavigation):
* bindings/generic/GenericBinding.h:
(WebCore::completeURL):
* bindings/js/JSDOMBinding.cpp:
(WebCore::toLexicalFrame):
(WebCore::toDynamicFrame):
* bindings/js/specialization/JSBindingState.cpp:
(WebCore::::activeFrame):
(WebCore::::firstFrame):
* bindings/js/specialization/JSBindingState.h:
* bindings/v8/V8Utilities.cpp:
(WebCore::callingOrEnteredFrame):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::locationAccessorSetter):
(WebCore::V8DOMWindow::openCallback):
* bindings/v8/specialization/V8BindingState.cpp:
(WebCore::::activeWindow):
(WebCore::::firstWindow):
(WebCore::::activeFrame):
(WebCore::::firstFrame):
* bindings/v8/specialization/V8BindingState.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6a0de84..87078ec 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2010-12-21 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Move V8 to common implementation of window.open
+ https://bugs.webkit.org/show_bug.cgi?id=51385
+
+ I also changed some function names to match WebKit style. There's a
+ bunch of code we can remove in the generic bindings now. I'll do that
+ in the next patch.
+
+ * bindings/generic/BindingDOMWindow.h:
+ (WebCore::::open):
+ * bindings/generic/BindingFrame.h:
+ (WebCore::::navigateIfAllowed):
+ * bindings/generic/BindingSecurity.h:
+ (WebCore::::canAccessWindow):
+ (WebCore::::allowPopUp):
+ (WebCore::::shouldAllowNavigation):
+ * bindings/generic/GenericBinding.h:
+ (WebCore::completeURL):
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::toLexicalFrame):
+ (WebCore::toDynamicFrame):
+ * bindings/js/specialization/JSBindingState.cpp:
+ (WebCore::::activeFrame):
+ (WebCore::::firstFrame):
+ * bindings/js/specialization/JSBindingState.h:
+ * bindings/v8/V8Utilities.cpp:
+ (WebCore::callingOrEnteredFrame):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::locationAccessorSetter):
+ (WebCore::V8DOMWindow::openCallback):
+ * bindings/v8/specialization/V8BindingState.cpp:
+ (WebCore::::activeWindow):
+ (WebCore::::firstWindow):
+ (WebCore::::activeFrame):
+ (WebCore::::firstFrame):
+ * bindings/v8/specialization/V8BindingState.h:
+
2010-12-21 Ryosuke Niwa <rniwa at webkit.org>
Unreviewed build fix for r74447.
diff --git a/WebCore/bindings/generic/BindingDOMWindow.h b/WebCore/bindings/generic/BindingDOMWindow.h
index 34e0177..04e3e7b 100644
--- a/WebCore/bindings/generic/BindingDOMWindow.h
+++ b/WebCore/bindings/generic/BindingDOMWindow.h
@@ -142,11 +142,11 @@ WebCore::DOMWindow* BindingDOMWindow<Binding>::open(State<Binding>* state,
if (!BindingSecurity<Binding>::canAccessFrame(state, frame, true))
return 0;
- Frame* firstFrame = state->getFirstFrame();
+ Frame* firstFrame = state->firstFrame();
if (!firstFrame)
return 0;
- Frame* activeFrame = state->getActiveFrame();
+ Frame* activeFrame = state->activeFrame();
// We may not have a calling context if we are invoked by a plugin
// via NPAPI.
if (!activeFrame)
diff --git a/WebCore/bindings/generic/BindingFrame.h b/WebCore/bindings/generic/BindingFrame.h
index c08a4d5..b194972 100644
--- a/WebCore/bindings/generic/BindingFrame.h
+++ b/WebCore/bindings/generic/BindingFrame.h
@@ -45,7 +45,7 @@ public:
template <class Binding>
void BindingFrame<Binding>::navigateIfAllowed(State<Binding>* state, Frame* frame, const KURL& url, bool lockHistory, bool lockBackForwardList)
{
- Frame* activeFrame = state->getActiveFrame();
+ Frame* activeFrame = state->activeFrame();
if (!activeFrame)
return;
if (!protocolIsJavaScript(url) || state->allowsAccessFromFrame(frame))
diff --git a/WebCore/bindings/generic/BindingSecurity.h b/WebCore/bindings/generic/BindingSecurity.h
index 1ce556c..8a39800 100644
--- a/WebCore/bindings/generic/BindingSecurity.h
+++ b/WebCore/bindings/generic/BindingSecurity.h
@@ -78,7 +78,7 @@ template <class Binding>
bool BindingSecurity<Binding>::canAccessWindow(State<Binding>* state,
DOMWindow* targetWindow)
{
- DOMWindow* activeWindow = state->getActiveWindow();
+ DOMWindow* activeWindow = state->activeWindow();
return canAccess(activeWindow, targetWindow);
}
@@ -119,7 +119,7 @@ bool BindingSecurity<Binding>::allowPopUp(State<Binding>* state)
if (state->processingUserGesture())
return true;
- Frame* frame = state->getFirstFrame();
+ Frame* frame = state->firstFrame();
ASSERT(frame);
Settings* settings = frame->settings();
return settings && settings->javaScriptCanOpenWindowsAutomatically();
@@ -147,7 +147,7 @@ bool BindingSecurity<Binding>::allowSettingSrcToJavascriptURL(State<Binding>* st
template <class Binding>
bool BindingSecurity<Binding>::shouldAllowNavigation(State<Binding>* state, Frame* frame)
{
- Frame* activeFrame = state->getActiveFrame();
+ Frame* activeFrame = state->activeFrame();
return activeFrame && activeFrame->loader()->shouldAllowNavigation(frame);
}
diff --git a/WebCore/bindings/generic/GenericBinding.h b/WebCore/bindings/generic/GenericBinding.h
index 8bf1343..d95b1c7 100644
--- a/WebCore/bindings/generic/GenericBinding.h
+++ b/WebCore/bindings/generic/GenericBinding.h
@@ -55,7 +55,7 @@ KURL completeURL(State<Binding>* state, const String& relativeURL)
{
// For historical reasons, we need to complete the URL using the
// dynamic frame.
- Frame* frame = state->getFirstFrame();
+ Frame* frame = state->firstFrame();
if (!frame)
return KURL();
return frame->loader()->completeURL(relativeURL);
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 267d18a..ed579d3 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -712,12 +712,12 @@ void printErrorMessageForFrame(Frame* frame, const String& message)
Frame* toLexicalFrame(ExecState* exec)
{
- return JSBindingState(exec).getActiveFrame();
+ return JSBindingState(exec).activeFrame();
}
Frame* toDynamicFrame(ExecState* exec)
{
- return JSBindingState(exec).getFirstFrame();
+ return JSBindingState(exec).firstFrame();
}
bool processingUserGesture()
diff --git a/WebCore/bindings/js/specialization/JSBindingState.cpp b/WebCore/bindings/js/specialization/JSBindingState.cpp
index 950b813..1aa6c7e 100644
--- a/WebCore/bindings/js/specialization/JSBindingState.cpp
+++ b/WebCore/bindings/js/specialization/JSBindingState.cpp
@@ -40,12 +40,12 @@ namespace WebCore {
class Frame;
-Frame* State<JSBinding>::getActiveFrame()
+Frame* State<JSBinding>::activeFrame()
{
return asJSDOMWindow(m_exec->lexicalGlobalObject())->impl()->frame();
}
-Frame* State<JSBinding>::getFirstFrame()
+Frame* State<JSBinding>::firstFrame()
{
return asJSDOMWindow(m_exec->dynamicGlobalObject())->impl()->frame();
}
diff --git a/WebCore/bindings/js/specialization/JSBindingState.h b/WebCore/bindings/js/specialization/JSBindingState.h
index 6640140..9f5afe7 100644
--- a/WebCore/bindings/js/specialization/JSBindingState.h
+++ b/WebCore/bindings/js/specialization/JSBindingState.h
@@ -56,8 +56,8 @@ public:
{
}
- Frame* getActiveFrame();
- Frame* getFirstFrame();
+ Frame* activeFrame();
+ Frame* firstFrame();
bool processingUserGesture();
diff --git a/WebCore/bindings/v8/V8Utilities.cpp b/WebCore/bindings/v8/V8Utilities.cpp
index e497071..7665a0a 100644
--- a/WebCore/bindings/v8/V8Utilities.cpp
+++ b/WebCore/bindings/v8/V8Utilities.cpp
@@ -101,7 +101,7 @@ bool processingUserGesture()
Frame* callingOrEnteredFrame()
{
- return V8BindingState::Only()->getActiveFrame();
+ return V8BindingState::Only()->activeFrame();
}
bool shouldAllowNavigation(Frame* frame)
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 3792a29..dc953b4 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -195,11 +195,11 @@ void V8DOMWindow::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v
DOMWindow* imp = V8DOMWindow::toNative(info.Holder());
State<V8Binding>* state = V8BindingState::Only();
- DOMWindow* activeWindow = state->getActiveWindow();
+ DOMWindow* activeWindow = state->activeWindow();
if (!activeWindow)
return;
- DOMWindow* firstWindow = state->getFirstWindow();
+ DOMWindow* firstWindow = state->firstWindow();
if (!firstWindow)
return;
@@ -509,19 +509,22 @@ v8::Handle<v8::Value> V8DOMWindow::showModalDialogCallback(const v8::Arguments&
v8::Handle<v8::Value> V8DOMWindow::openCallback(const v8::Arguments& args)
{
INC_STATS("DOM.DOMWindow.open()");
+ DOMWindow* impl = V8DOMWindow::toNative(args.Holder());
- DOMWindow* parent = V8DOMWindow::toNative(args.Holder());
- String urlString = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
- AtomicString frameName = (args[1]->IsUndefined() || args[1]->IsNull()) ? "_blank" : AtomicString(toWebCoreString(args[1]));
- WindowFeatures rawFeatures(toWebCoreStringWithNullOrUndefinedCheck(args[2]));
- DOMWindow* child = V8BindingDOMWindow::open(V8BindingState::Only(), parent, urlString, frameName, rawFeatures);
+ V8BindingState* state = V8BindingState::Only();
- if (!child)
- return v8::Undefined();
+ DOMWindow* activeWindow = state->activeWindow();
+ DOMWindow* firstWindow = state->firstWindow();
- return toV8(child);
-}
+ EXCEPTION_BLOCK(String, urlString, toWebCoreStringWithNullOrUndefinedCheck(args[0]));
+ EXCEPTION_BLOCK(AtomicString, frameName, (args[1]->IsUndefined() || args[1]->IsNull()) ? "_blank" : AtomicString(toWebCoreString(args[1])));
+ EXCEPTION_BLOCK(String, windowFeaturesString, toWebCoreStringWithNullOrUndefinedCheck(args[2]));
+ RefPtr<DOMWindow> openedWindow = impl->open(urlString, frameName, windowFeaturesString, activeWindow, firstWindow);
+ if (!openedWindow)
+ return v8::Undefined();
+ return toV8(openedWindow.release());
+}
v8::Handle<v8::Value> V8DOMWindow::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
{
diff --git a/WebCore/bindings/v8/specialization/V8BindingState.cpp b/WebCore/bindings/v8/specialization/V8BindingState.cpp
index f477702..891272c 100644
--- a/WebCore/bindings/v8/specialization/V8BindingState.cpp
+++ b/WebCore/bindings/v8/specialization/V8BindingState.cpp
@@ -44,7 +44,7 @@ State<V8Binding>* State<V8Binding>::Only()
return &globalV8BindingState;
}
-DOMWindow* State<V8Binding>::getActiveWindow()
+DOMWindow* State<V8Binding>::activeWindow()
{
v8::Local<v8::Context> activeContext = v8::Context::GetCalling();
if (activeContext.IsEmpty()) {
@@ -55,12 +55,12 @@ DOMWindow* State<V8Binding>::getActiveWindow()
return V8Proxy::retrieveWindow(activeContext);
}
-DOMWindow* State<V8Binding>::getFirstWindow()
+DOMWindow* State<V8Binding>::firstWindow()
{
return V8Proxy::retrieveWindow(v8::Context::GetEntered());
}
-Frame* State<V8Binding>::getActiveFrame()
+Frame* State<V8Binding>::activeFrame()
{
Frame* frame = V8Proxy::retrieveFrameForCallingContext();
if (!frame) {
@@ -74,7 +74,7 @@ Frame* State<V8Binding>::getActiveFrame()
return frame;
}
-Frame* State<V8Binding>::getFirstFrame()
+Frame* State<V8Binding>::firstFrame()
{
return V8Proxy::retrieveFrameForEnteredContext();
}
diff --git a/WebCore/bindings/v8/specialization/V8BindingState.h b/WebCore/bindings/v8/specialization/V8BindingState.h
index cdd0ef6..c472484 100644
--- a/WebCore/bindings/v8/specialization/V8BindingState.h
+++ b/WebCore/bindings/v8/specialization/V8BindingState.h
@@ -49,11 +49,11 @@ public:
// Reports an error message (without delay) if the security check fails.
static void immediatelyReportUnsafeAccessTo(Frame*);
- DOMWindow* getActiveWindow();
- DOMWindow* getFirstWindow();
+ DOMWindow* activeWindow();
+ DOMWindow* firstWindow();
- Frame* getActiveFrame();
- Frame* getFirstFrame();
+ Frame* activeFrame();
+ Frame* firstFrame();
bool processingUserGesture();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list