summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp35
-rw-r--r--Source/WebCore/plugins/android/PluginViewAndroid.cpp2
-rw-r--r--Source/WebKit/android/plugins/android_npapi.h1
3 files changed, 30 insertions, 8 deletions
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index dcaf03a..2def2a6 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -381,8 +381,11 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
Node* currentFocusedNode = m_frame->document()->focusedNode();
if (currentFocusedNode)
currentFocusedNode->aboutToUnload();
- m_pageDismissalEventBeingDispatched = true;
- if (m_frame->domWindow()) {
+// ANDROID
+ // See http://b/issue?id=5264509
+ if (m_frame->domWindow() && !m_pageDismissalEventBeingDispatched) {
+ m_pageDismissalEventBeingDispatched = true;
+// END ANDROID
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide)
m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
if (!m_frame->document()->inPageCache()) {
@@ -1837,6 +1840,20 @@ void FrameLoader::setDocumentLoader(DocumentLoader* loader)
m_documentLoader->detachFromFrame();
m_documentLoader = loader;
+
+ // The following abomination is brought to you by the unload event.
+ // The detachChildren() call above may trigger a child frame's unload event,
+ // which could do something obnoxious like call document.write("") on
+ // the main frame, which results in detaching children while detaching children.
+ // This can cause the new m_documentLoader to be detached from its Frame*, but still
+ // be alive. To make matters worse, DocumentLoaders with a null Frame* aren't supposed
+ // to happen when they're still alive (and many places below us on the stack think the
+ // DocumentLoader is still usable). Ergo, we reattach loader to its Frame, and pretend
+ // like nothing ever happened.
+ if (m_documentLoader && !m_documentLoader->frame()) {
+ ASSERT(!m_documentLoader->isLoading());
+ m_documentLoader->setFrame(m_frame);
+ }
}
void FrameLoader::setPolicyDocumentLoader(DocumentLoader* loader)
@@ -2563,12 +2580,14 @@ void FrameLoader::frameLoadCompleted()
void FrameLoader::detachChildren()
{
- // FIXME: Is it really necessary to do this in reverse order?
- Frame* previous;
- for (Frame* child = m_frame->tree()->lastChild(); child; child = previous) {
- previous = child->tree()->previousSibling();
- child->loader()->detachFromParent();
- }
+ typedef Vector<RefPtr<Frame> > FrameVector;
+ FrameVector childrenToDetach;
+ childrenToDetach.reserveCapacity(m_frame->tree()->childCount());
+ for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree()->previousSibling())
+ childrenToDetach.append(child);
+ FrameVector::iterator end = childrenToDetach.end();
+ for (FrameVector::iterator it = childrenToDetach.begin(); it != end; it++)
+ (*it)->loader()->detachFromParent();
}
void FrameLoader::closeAndRemoveChild(Frame* child)
diff --git a/Source/WebCore/plugins/android/PluginViewAndroid.cpp b/Source/WebCore/plugins/android/PluginViewAndroid.cpp
index 8ac6486..dba7d3b 100644
--- a/Source/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/Source/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -112,6 +112,7 @@ extern void ANPSystemInterfaceV1_Init(ANPInterface* value);
extern void ANPSystemInterfaceV2_Init(ANPInterface* value);
extern void ANPNativeWindowInterfaceV0_Init(ANPInterface* value);
extern void ANPVideoInterfaceV0_Init(ANPInterface* value);
+extern void ANPVideoInterfaceV1_Init(ANPInterface* value);
struct VarProcPair {
int enumValue;
@@ -142,6 +143,7 @@ static const VarProcPair gVarProcs[] = {
{ VARPROCLINE(SystemInterfaceV2) },
{ VARPROCLINE(NativeWindowInterfaceV0) },
{ VARPROCLINE(VideoInterfaceV0) },
+ { VARPROCLINE(VideoInterfaceV1) },
};
/* return true if var was an interface request (error will be set accordingly)
diff --git a/Source/WebKit/android/plugins/android_npapi.h b/Source/WebKit/android/plugins/android_npapi.h
index bcb0bbb..5305dc8 100644
--- a/Source/WebKit/android/plugins/android_npapi.h
+++ b/Source/WebKit/android/plugins/android_npapi.h
@@ -130,6 +130,7 @@ typedef uint32_t ANPMatrixFlag;
#define kWindowInterfaceV2_ANPGetValue ((NPNVariable)1018)
#define kNativeWindowInterfaceV0_ANPGetValue ((NPNVariable)1019)
+#define kVideoInterfaceV1_ANPGetValue ((NPNVariable)1020)
/** queries for the drawing models supported on this device.