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;
// 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);
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
+
}
void deliverData();
void destroyStream(NPReason);
void destroyStream();
-
+#if PLATFORM(ANDROID)
+ int deliveryDelay() const;
+#endif
ResourceRequest m_resourceRequest;
ResourceResponse m_resourceResponse;