diff options
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/bridge/jni/JNIUtility.cpp | 2 | ||||
-rw-r--r-- | WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp | 2 | ||||
-rw-r--r-- | WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp | 6 | ||||
-rw-r--r-- | WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp | 20 | ||||
-rw-r--r-- | WebCore/bridge/jni/v8/JavaNPObjectV8.cpp | 2 | ||||
-rw-r--r-- | WebCore/bridge/npapi.h | 9 | ||||
-rw-r--r-- | WebCore/config.h | 13 | ||||
-rw-r--r-- | WebCore/history/CachedFrame.cpp | 4 | ||||
-rw-r--r-- | WebCore/loader/FrameLoader.cpp | 6 | ||||
-rw-r--r-- | WebCore/plugins/PluginStream.cpp | 21 | ||||
-rw-r--r-- | WebCore/plugins/PluginStream.h | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderBox.cpp | 16 |
12 files changed, 47 insertions, 58 deletions
diff --git a/WebCore/bridge/jni/JNIUtility.cpp b/WebCore/bridge/jni/JNIUtility.cpp index ee45710..e558955 100644 --- a/WebCore/bridge/jni/JNIUtility.cpp +++ b/WebCore/bridge/jni/JNIUtility.cpp @@ -283,7 +283,7 @@ jvalue getJNIField(jobject obj, JNIType type, const char* name, const char* sign JNIEnv* env = getJNIEnv(); jvalue result; - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); if (obj && jvm && env) { jclass cls = env->GetObjectClass(obj); if (cls) { diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp index 4e1b0d2..8776cd2 100644 --- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp +++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp @@ -83,7 +83,7 @@ jvalue JavaField::dispatchValueFromInstance(ExecState* exec, const JavaInstance* JNIEnv* env = getJNIEnv(); jvalue result; - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); jclass cls = env->GetObjectClass(fieldJInstance); if (cls) { jmethodID mid = env->GetMethodID(cls, name, sig); diff --git a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp index e238ab8..8ce150f 100644 --- a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp +++ b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp @@ -219,7 +219,8 @@ jvalue convertValueToJValue(ExecState* exec, JSValue value, JNIType jniType, con result.l = javaString; } } else if (!result.l) - bzero(&result, sizeof(jvalue)); // Handle it the same as a void case + // ANDROID + memset(&result, 0, sizeof(jvalue)); // Handle it the same as a void case } break; @@ -277,7 +278,8 @@ jvalue convertValueToJValue(ExecState* exec, JSValue value, JNIType jniType, con default: case void_type: { - bzero(&result, sizeof(jvalue)); + // ANDROID + memset(&result, 0, sizeof(jvalue)); } break; } diff --git a/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp b/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp index 9352983..1bdae53 100644 --- a/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp +++ b/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp @@ -71,7 +71,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja result.l = javaString; } } else if (!result.l) - bzero(&result, sizeof(jvalue)); // Handle it the same as a void case + memset(&result, 0, sizeof(jvalue)); // Handle it the same as a void case } break; @@ -80,7 +80,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja if (type == NPVariantType_Bool) result.z = NPVARIANT_TO_BOOLEAN(value); else - bzero(&result, sizeof(jvalue)); // as void case + memset(&result, 0, sizeof(jvalue)); // as void case } break; @@ -89,7 +89,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja if (type == NPVariantType_Int32) result.b = static_cast<char>(NPVARIANT_TO_INT32(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -98,7 +98,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja if (type == NPVariantType_Int32) result.c = static_cast<char>(NPVARIANT_TO_INT32(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -107,7 +107,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja if (type == NPVariantType_Int32) result.s = static_cast<jshort>(NPVARIANT_TO_INT32(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -116,7 +116,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja if (type == NPVariantType_Int32) result.i = static_cast<jint>(NPVARIANT_TO_INT32(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -127,7 +127,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja else if (type == NPVariantType_Double) result.j = static_cast<jlong>(NPVARIANT_TO_DOUBLE(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -138,7 +138,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja else if (type == NPVariantType_Double) result.f = static_cast<jfloat>(NPVARIANT_TO_DOUBLE(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -149,7 +149,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja else if (type == NPVariantType_Double) result.d = static_cast<jdouble>(NPVARIANT_TO_DOUBLE(value)); else - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; @@ -159,7 +159,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja default: case void_type: { - bzero(&result, sizeof(jvalue)); + memset(&result, 0, sizeof(jvalue)); } break; } diff --git a/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp b/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp index 9c39c25..54cb8d6 100644 --- a/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp +++ b/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp @@ -41,7 +41,7 @@ static NPObject* AllocJavaNPObject(NPP, NPClass*) JavaNPObject* obj = static_cast<JavaNPObject*>(malloc(sizeof(JavaNPObject))); if (!obj) return 0; - bzero(obj, sizeof(JavaNPObject)); + memset(obj, 0, sizeof(JavaNPObject)); return reinterpret_cast<NPObject*>(obj); } diff --git a/WebCore/bridge/npapi.h b/WebCore/bridge/npapi.h index 41f9bda..f0690b9 100644 --- a/WebCore/bridge/npapi.h +++ b/WebCore/bridge/npapi.h @@ -374,8 +374,13 @@ typedef enum { NPPVpluginCoreAnimationLayer = 1003 #endif -#ifdef ANDROID - // TODO(andreip): Remove? +#if PLATFORM(ANDROID) + /* Used when the plugin returns 0 from NPN_WriteReady and wishes the browser + * to wait a certain amount of millis before calling NPN_WriteReady again. + */ + NPPDataDeliveryDelayMs = 100, + + // TODO(reed): upstream NPPFakeValueToForce32Bits = 0x7FFFFFFF #endif } NPPVariable; diff --git a/WebCore/config.h b/WebCore/config.h index 702d244..9c14b28 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -137,10 +137,6 @@ #define ANDROID_FIX -// Ensure that the fixed elements are set relative to the screen -// rather than the virtual viewport -#define ANDROID_FIXED_ELEMENTS - // Passes the webkit-originated changes of a focused textfield to our UI // thread #define ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS @@ -195,15 +191,6 @@ // or if javascript tried to change the location. #define ANDROID_USER_GESTURE -// Enable pages with unloadEvent for page cache. See the blog in -// http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ about this issue. -// And see the bug, https://bugs.webkit.org/show_bug.cgi?id=29021, for details. -// Currently WebKit doesn't cache pages with unloadEvent. This means that we -// won't cache a lot of common sites like cnn.com. Experimenting caching pages -// with unloadEvent for better back/forward navigation. Invoke unloadEvent when -// a page is cached. Invoke loadEvent when a page is restored. -#define ANDROID_PAGE_CACHE_UNLOAD - #endif /* PLATFORM(ANDROID) */ #ifdef __cplusplus diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp index a027b62..a7261dd 100644 --- a/WebCore/history/CachedFrame.cpp +++ b/WebCore/history/CachedFrame.cpp @@ -105,10 +105,6 @@ void CachedFrameBase::restore() for (unsigned i = 0; i < m_childFrames.size(); ++i) m_childFrames[i]->open(); -#ifdef ANDROID_PAGE_CACHE_UNLOAD - // matches pageshowEvent as in Document::implicitClose() - m_document->dispatchWindowLoadEvent(); -#endif m_document->dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), m_document); #if ENABLE(TOUCH_EVENTS) if (m_document->hasListenerType(Document::TOUCH_LISTENER)) diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index be782f1..514f98a 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -545,9 +545,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic if (m_frame->domWindow()) { if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document()); -#ifndef ANDROID_PAGE_CACHE_UNLOAD if (!m_frame->document()->inPageCache()) -#endif m_frame->domWindow()->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), m_frame->domWindow()->document()); } m_unloadEventBeingDispatched = false; @@ -1552,9 +1550,7 @@ bool FrameLoader::canCachePageContainingThisFrame() // the right NPObjects. See <rdar://problem/5197041> for more information. && !m_containsPlugIns && !m_URL.protocolIs("https") -#ifndef ANDROID_PAGE_CACHE_UNLOAD && (!m_frame->domWindow() || !m_frame->domWindow()->hasEventListeners(eventNames().unloadEvent)) -#endif #if ENABLE(DATABASE) && !m_frame->document()->hasOpenDatabases() #endif @@ -1699,10 +1695,8 @@ bool FrameLoader::logCanCacheFrameDecision(int indentLevel) { PCLOG(" -Frame contains plugins"); cannotCache = true; } if (m_URL.protocolIs("https")) { PCLOG(" -Frame is HTTPS"); cannotCache = true; } -#ifndef ANDROID_PAGE_CACHE_UNLOAD if (m_frame->domWindow() && m_frame->domWindow()->hasEventListeners(eventNames().unloadEvent)) { PCLOG(" -Frame has an unload event listener"); cannotCache = true; } -#endif #if ENABLE(DATABASE) if (m_frame->document()->hasOpenDatabases()) { PCLOG(" -Frame has open database handles"); cannotCache = true; } diff --git a/WebCore/plugins/PluginStream.cpp b/WebCore/plugins/PluginStream.cpp index 1e91c51..0f60fe3 100644 --- a/WebCore/plugins/PluginStream.cpp +++ b/WebCore/plugins/PluginStream.cpp @@ -349,8 +349,13 @@ void PluginStream::deliverData() // TODO: This needs to be upstreamed. if (m_loader) m_loader->pauseLoad(true); -#endif + + // ask the plugin for a delay value. + int delay = deliveryDelay(); + m_delayDeliveryTimer.startOneShot(delay); +#else m_delayDeliveryTimer.startOneShot(0); +#endif break; } else { deliveryBytes = min(deliveryBytes, totalBytes - totalBytesDelivered); @@ -485,4 +490,18 @@ bool PluginStream::wantsAllStreams() const return result != 0; } +#if PLATFORM(ANDROID) +int PluginStream::deliveryDelay() const +{ + if (!m_pluginFuncs->getvalue) + return 0; + + int delay = 0; + if (m_pluginFuncs->getvalue(m_instance, NPPDataDeliveryDelayMs, &delay) != NPERR_NO_ERROR) + return 0; + + return delay; +} +#endif + } diff --git a/WebCore/plugins/PluginStream.h b/WebCore/plugins/PluginStream.h index dc08f01..29a2644 100644 --- a/WebCore/plugins/PluginStream.h +++ b/WebCore/plugins/PluginStream.h @@ -88,7 +88,9 @@ namespace WebCore { void deliverData(); void destroyStream(NPReason); void destroyStream(); - +#if PLATFORM(ANDROID) + int deliveryDelay() const; +#endif ResourceRequest m_resourceRequest; ResourceResponse m_resourceResponse; diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index 91f72ed..92c3d99 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -56,10 +56,6 @@ #include "WMLNames.h" #endif -#ifdef ANDROID_FIXED_ELEMENTS -#include "PlatformBridge.h" -#endif - using namespace std; namespace WebCore { @@ -1790,12 +1786,6 @@ void RenderBox::calcVerticalMargins() int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* containingBlock) const { -#ifdef ANDROID_FIXED_ELEMENTS - if (style()->position() == FixedPosition && containingBlock->isRenderView()) { - const RenderView* view = toRenderView(containingBlock); - return PlatformBridge::screenWidth(view->frameView()); - } -#endif if (containingBlock->isBox()) { const RenderBox* containingBlockBox = toRenderBox(containingBlock); return containingBlockBox->width() - containingBlockBox->borderLeft() - containingBlockBox->borderRight() - containingBlockBox->verticalScrollbarWidth(); @@ -1826,12 +1816,6 @@ int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* con int RenderBox::containingBlockHeightForPositioned(const RenderBoxModelObject* containingBlock) const { -#ifdef ANDROID_FIXED_ELEMENTS - if (style()->position() == FixedPosition && containingBlock->isRenderView()) { - const RenderView* view = toRenderView(containingBlock); - return PlatformBridge::screenHeight(view->frameView()); - } -#endif int heightResult = 0; if (containingBlock->isBox()) heightResult = toRenderBox(containingBlock)->height(); |