diff options
Diffstat (limited to 'Source/WebCore')
4 files changed, 13 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/android/MediaLayer.cpp b/Source/WebCore/platform/graphics/android/MediaLayer.cpp index ae65173..5625bbe 100644 --- a/Source/WebCore/platform/graphics/android/MediaLayer.cpp +++ b/Source/WebCore/platform/graphics/android/MediaLayer.cpp @@ -40,11 +40,11 @@ namespace WebCore { -MediaLayer::MediaLayer(jobject weakWebViewRef) : LayerAndroid((RenderLayer*) NULL) +MediaLayer::MediaLayer(jobject webViewRef) : LayerAndroid((RenderLayer*) NULL) { - m_contentTexture = new MediaTexture(weakWebViewRef); + m_contentTexture = new MediaTexture(webViewRef); m_contentTexture->incStrong(this); - m_videoTexture = new MediaTexture(weakWebViewRef); + m_videoTexture = new MediaTexture(webViewRef); m_videoTexture->incStrong(this); m_isCopy = false; diff --git a/Source/WebCore/platform/graphics/android/MediaLayer.h b/Source/WebCore/platform/graphics/android/MediaLayer.h index dd58674..6d08ed6 100644 --- a/Source/WebCore/platform/graphics/android/MediaLayer.h +++ b/Source/WebCore/platform/graphics/android/MediaLayer.h @@ -32,7 +32,7 @@ namespace WebCore { class MediaLayer : public LayerAndroid { public: - MediaLayer(jobject weakWebViewRef); + MediaLayer(jobject webViewRef); MediaLayer(const MediaLayer& layer); virtual ~MediaLayer(); diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.cpp b/Source/WebCore/platform/graphics/android/MediaTexture.cpp index 96d136a..eb143a4 100644 --- a/Source/WebCore/platform/graphics/android/MediaTexture.cpp +++ b/Source/WebCore/platform/graphics/android/MediaTexture.cpp @@ -48,9 +48,15 @@ namespace WebCore { -MediaTexture::MediaTexture(jobject weakWebViewRef) : android::LightRefBase<MediaTexture>() +MediaTexture::MediaTexture(jobject webViewRef) : android::LightRefBase<MediaTexture>() { - m_weakWebViewRef = weakWebViewRef; + if (webViewRef) { + JNIEnv* env = JSC::Bindings::getJNIEnv(); + m_weakWebViewRef = env->NewWeakGlobalRef(webViewRef); + } else { + m_weakWebViewRef = 0; + } + m_textureId = 0; m_dimensions.setEmpty(); m_newWindowRequest = false; diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.h b/Source/WebCore/platform/graphics/android/MediaTexture.h index d7ae9cb..c617264 100644 --- a/Source/WebCore/platform/graphics/android/MediaTexture.h +++ b/Source/WebCore/platform/graphics/android/MediaTexture.h @@ -36,7 +36,7 @@ class MediaListener; class MediaTexture : public android::LightRefBase<MediaTexture> { public: - MediaTexture(jobject weakWebViewRef); + MediaTexture(jobject webViewRef); ~MediaTexture(); void initNativeWindowIfNeeded(); |