diff options
-rw-r--r-- | WebCore/plugins/android/PluginViewAndroid.cpp | 16 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp | 7 |
2 files changed, 19 insertions, 4 deletions
diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp index fc7bf86..09117ae 100644 --- a/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/WebCore/plugins/android/PluginViewAndroid.cpp @@ -43,6 +43,7 @@ #include "KeyboardEvent.h" #include "MIMETypeRegistry.h" #include "MouseEvent.h" +#include "NetworkStateNotifier.h" #include "NotImplemented.h" #include "Page.h" #include "PlatformGraphicsContext.h" @@ -290,6 +291,11 @@ NPError PluginView::getValueStatic(NPNVariable variable, void* value) { // our interface query is valid with no NPP instance NPError error = NPERR_GENERIC_ERROR; + if ((value != NULL) && (variable == NPNVisOfflineBool)) { + bool* retValue = static_cast<bool*>(value); + *retValue = !networkStateNotifier().onLine(); + return NPERR_NO_ERROR; + } (void)anp_getInterface(variable, value, &error); return error; } @@ -431,6 +437,15 @@ NPError PluginView::getValue(NPNVariable variable, void* value) *retObject = android::WebViewCore::getWebViewCore(parent())->getWebViewJavaObject(); return NPERR_NO_ERROR; } + + case NPNVisOfflineBool: { + if (value == NULL) { + return NPERR_GENERIC_ERROR; + } + bool* retValue = static_cast<bool*>(value); + *retValue = !networkStateNotifier().onLine(); + return NPERR_NO_ERROR; + } case kSupportedDrawingModel_ANPGetValue: { uint32_t* bits = reinterpret_cast<uint32_t*>(value); @@ -549,4 +564,3 @@ void PluginView::setParentVisible(bool) { } } // namespace WebCore - diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 95a9cf6..a99fedd 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -330,11 +330,12 @@ void FrameLoaderClientAndroid::dispatchDidFailProvisionalLoad(const ResourceErro // Replace all occurances of %e with the error text s = s.replace("%e", error.localizedDescription()); - + // Create the request and the substitute data and tell the FrameLoader to // load with the replacement data. - loadDataIntoFrame(m_frame, m_frame->loader()->baseURL(), - error.failingURL(), s); + // use KURL(const char*) as KURL(const String& url) can trigger ASSERT for + // invalidate URL string. + loadDataIntoFrame(m_frame, KURL(data), error.failingURL(), s); // Delete the asset. delete a; |