diff --git a/src/Tizen.NUI/src/internal/WebView/WebContext.cs b/src/Tizen.NUI/src/internal/WebView/WebContext.cs index fcc3a66b5c3..17e0eb141df 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebContext.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebContext.cs @@ -518,7 +518,11 @@ public void GetFormPasswordList(PasswordDataListAcquiredCallback callback) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterDownloadStartedCallback(DownloadStartedCallback callback) { - IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); + IntPtr ip = IntPtr.Zero; + if (callback != null) + { + ip = Marshal.GetFunctionPointerForDelegate(callback); + } Interop.WebContext.RegisterDownloadStartedCallback(SwigCPtr, new HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -530,7 +534,11 @@ public void RegisterDownloadStartedCallback(DownloadStartedCallback callback) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterMimeOverriddenCallback(MimeOverriddenCallback callback) { - IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); + IntPtr ip = IntPtr.Zero; + if (callback != null) + { + ip = Marshal.GetFunctionPointerForDelegate(callback); + } Interop.WebContext.RegisterMimeOverriddenCallback(SwigCPtr, new HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/src/Tizen.NUI/src/internal/WebView/WebCookieManager.cs b/src/Tizen.NUI/src/internal/WebView/WebCookieManager.cs index e9a38ff9ea4..adaed29c4f6 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebCookieManager.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebCookieManager.cs @@ -56,6 +56,11 @@ public event EventHandler CookieChanged remove { cookieChangedEventHandler -= value; + if (cookieChangedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebCookieManager.CookieChangedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } diff --git a/src/Tizen.NUI/src/public/WebView/WebView.cs b/src/Tizen.NUI/src/public/WebView/WebView.cs index 0ecc8f1fe26..5c3fab14bb7 100755 --- a/src/Tizen.NUI/src/public/WebView/WebView.cs +++ b/src/Tizen.NUI/src/public/WebView/WebView.cs @@ -305,6 +305,11 @@ public event EventHandler PageLoadStarted remove { pageLoadStartedEventHandler -= value; + if (pageLoadStartedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterPageLoadStartedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -328,6 +333,11 @@ public event EventHandler PageLoading remove { pageLoadingEventHandler -= value; + if (pageLoadingEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterPageLoadInProgressCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -351,6 +361,11 @@ public event EventHandler PageLoadFinished remove { pageLoadFinishedEventHandler -= value; + if (pageLoadFinishedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterPageLoadFinishedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -374,6 +389,11 @@ public event EventHandler PageLoadError remove { pageLoadErrorEventHandler -= value; + if (pageLoadErrorEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterPageLoadErrorCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -397,6 +417,11 @@ public event EventHandler ScrollEdgeReached remove { scrollEdgeReachedEventHandler -= value; + if (scrollEdgeReachedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterScrollEdgeReachedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -420,6 +445,11 @@ public event EventHandler UrlChanged remove { urlChangedEventHandler -= value; + if (urlChangedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterUrlChangedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -443,6 +473,11 @@ public event EventHandler FormRepostPol remove { formRepostPolicyDecidedEventHandler -= value; + if (formRepostPolicyDecidedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterFormRepostDecidedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -466,6 +501,11 @@ public event EventHandler FrameRendered remove { frameRenderedEventHandler -= value; + if (frameRenderedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterFrameRenderedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -489,6 +529,11 @@ public event EventHandler ResponsePolicyDecided remove { responsePolicyDecidedEventHandler -= value; + if (responsePolicyDecidedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterResponsePolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -512,6 +557,11 @@ public event EventHandler NavigationPolicyDecided remove { navigationPolicyDecidedEventHandler -= value; + if (navigationPolicyDecidedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterNavigationPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -535,6 +585,11 @@ public event EventHandlerWithReturnType NewWindowCre remove { newWindowCreatedEventHandler -= value; + if (newWindowCreatedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterNewWindowCreatedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -558,6 +613,11 @@ public event EventHandler CertificateConfir remove { certificateConfirmedEventHandler -= value; + if (certificateConfirmedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterCertificateConfirmedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -581,6 +641,11 @@ public event EventHandler SslCertificateCha remove { sslCertificateChangedEventHandler -= value; + if (sslCertificateChangedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterSslCertificateChangedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -604,6 +669,11 @@ public event EventHandler HttpAuthRequested remove { httpAuthRequestedEventHandler -= value; + if (httpAuthRequestedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterHttpAuthHandlerCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -627,6 +697,11 @@ public event EventHandler ConsoleMessage remove { consoleMessageReceivedEventHandler -= value; + if (consoleMessageReceivedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterConsoleMessageReceivedCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -650,6 +725,11 @@ public event EventHandler ContextMenuShown remove { contextMenuShownEventHandler -= value; + if (contextMenuShownEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterContextMenuShownCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -673,6 +753,11 @@ public event EventHandler ContextMenuHidden remove { contextMenuHiddenEventHandler -= value; + if (contextMenuHiddenEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterContextMenuHiddenCallback(SwigCPtr, new HandleRef(this, ip)); + } } } @@ -1844,9 +1929,12 @@ public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHand [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); + IntPtr ip = IntPtr.Zero; + if (callback != null) + { + ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); + } Interop.WebView.RegisterJavaScriptAlertCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -1867,9 +1955,12 @@ public void JavaScriptAlertReply() [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); + IntPtr ip = IntPtr.Zero; + if (callback != null) + { + ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); + } Interop.WebView.RegisterJavaScriptConfirmCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -1891,9 +1982,12 @@ public void JavaScriptConfirmReply(bool confirmed) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); + IntPtr ip = IntPtr.Zero; + if (callback != null) + { + ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); + } Interop.WebView.RegisterJavaScriptPromptCallback(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }