68df5241bcdb55c9c82863b085a4722c4e02e3ff
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / WebView / WebContext.cs
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// WebContext is a class for context of web view.
26     /// </summary>
27     [EditorBrowsable(EditorBrowsableState.Never)]
28     public class WebContext : Disposable
29     {
30         private string appId;
31         private string appVersion;
32         private float timeOffset;
33         private ApplicationType applicationType;
34         private SecurityOriginListAcquiredCallback securityOriginListAcquiredCallback;
35         private readonly WebContextSecurityOriginListAcquiredProxyCallback securityOriginListAcquiredProxyCallback;
36         private PasswordDataListAcquiredCallback passwordDataListAcquiredCallback;
37         private readonly WebContextPasswordDataListAcquiredProxyCallback passwordDataListAcquiredProxyCallback;
38
39         internal WebContext(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
40         {
41             securityOriginListAcquiredProxyCallback = OnSecurityOriginListAcquired;
42             passwordDataListAcquiredProxyCallback = OnPasswordDataListAcquired;
43         }
44
45         /// <summary>
46         /// The callback function that is invoked when security origin list is acquired.
47         /// </summary>
48         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
49         [EditorBrowsable(EditorBrowsableState.Never)]
50         public delegate void SecurityOriginListAcquiredCallback(WebSecurityOriginList list);
51
52         /// <summary>
53         /// The callback function that is invoked when storage usage is acquired.
54         /// </summary>
55         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
56         [EditorBrowsable(EditorBrowsableState.Never)]
57         public delegate void StorageUsageAcquiredCallback(ulong usage);
58
59         /// <summary>
60         /// The callback function that is invoked when security origin list is acquired.
61         /// </summary>
62         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
63         [EditorBrowsable(EditorBrowsableState.Never)]
64         public delegate void PasswordDataListAcquiredCallback(WebPasswordDataList list);
65
66         /// <summary>
67         /// The callback function that is invoked when download is started.
68         /// </summary>
69         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
70         [EditorBrowsable(EditorBrowsableState.Never)]
71         public delegate void DownloadStartedCallback(string url);
72
73         /// <summary>
74         /// The callback function that is invoked when current mime type need be overridden.
75         /// </summary>
76         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
77         [EditorBrowsable(EditorBrowsableState.Never)]
78         public delegate bool MimeOverriddenCallback(string url, string currentMime, string newMime);
79
80         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81         private delegate void WebContextSecurityOriginListAcquiredProxyCallback(IntPtr list);
82
83         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
84         private delegate void WebContextPasswordDataListAcquiredProxyCallback(IntPtr list);
85
86         /// <summary>
87         /// Cache model
88         /// </summary>
89         [EditorBrowsable(EditorBrowsableState.Never)]
90         public enum CacheModelType
91         {
92             /// <summary>
93             /// The smallest cache capacity
94             /// </summary>
95             [EditorBrowsable(EditorBrowsableState.Never)]
96             DocumentViewer,
97
98             /// <summary>
99             /// The bigger cache capacity than DocumentBrowser
100             /// </summary>
101             [EditorBrowsable(EditorBrowsableState.Never)]
102             DocumentBrowser,
103
104             /// <summary>
105             /// The biggest cache capacity.
106             /// </summary>
107             [EditorBrowsable(EditorBrowsableState.Never)]
108             PrimaryWebBrowser,
109         }
110
111         /// <summary>
112         /// Application type
113         /// </summary>
114         [EditorBrowsable(EditorBrowsableState.Never)]
115         public enum ApplicationType
116         {
117             /// <summary>
118             /// Web browser.
119             /// </summary>
120             [EditorBrowsable(EditorBrowsableState.Never)]
121             WebBrowser,
122
123             /// <summary>
124             /// Hbb tv.
125             /// </summary>
126             [EditorBrowsable(EditorBrowsableState.Never)]
127             HbbTv,
128
129             /// <summary>
130             /// Web runtime.
131             /// </summary>
132             [EditorBrowsable(EditorBrowsableState.Never)]
133             WebRuntime,
134
135             /// <summary>
136             /// Other.
137             /// </summary>
138             [EditorBrowsable(EditorBrowsableState.Never)]
139             Other,
140         }
141
142         /// <summary>
143         /// Cache model
144         /// </summary>
145         [EditorBrowsable(EditorBrowsableState.Never)]
146         public CacheModelType CacheModel
147         {
148             get
149             {
150                 return (CacheModelType)Interop.WebContext.GetCacheModel(SwigCPtr);
151             }
152             set
153             {
154                 Interop.WebContext.SetCacheModel(SwigCPtr, (int)value);
155                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156             }
157         }
158
159         /// <summary>
160         /// Proxy url.
161         /// </summary>
162         [EditorBrowsable(EditorBrowsableState.Never)]
163         public string ProxyUrl
164         {
165             get
166             {
167                 return Interop.WebContext.GetProxyUri(SwigCPtr);
168             }
169             set
170             {
171                 if (value != null)
172                 {
173                     Interop.WebContext.SetProxyUri(SwigCPtr, value);
174                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175                 }
176             }
177         }
178
179         /// <summary>
180         /// Certificate file path.
181         /// </summary>
182         [EditorBrowsable(EditorBrowsableState.Never)]
183         public string CertificateFilePath
184         {
185             get
186             {
187                 return Interop.WebContext.GetCertificateFilePath(SwigCPtr);
188             }
189             set
190             {
191                 Interop.WebContext.SetCertificateFilePath(SwigCPtr, value);
192                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193             }
194         }
195
196         /// <summary>
197         /// Enables cache or not.
198         /// </summary>
199         [EditorBrowsable(EditorBrowsableState.Never)]
200         public bool CacheEnabled
201         {
202             get
203             {
204                 return Interop.WebContext.IsCacheEnabled(SwigCPtr);
205             }
206             set
207             {
208                 Interop.WebContext.EnableCache(SwigCPtr, value);
209                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210             }
211         }
212
213         /// <summary>
214         /// App id.
215         /// </summary>
216         [EditorBrowsable(EditorBrowsableState.Never)]
217         public string AppId
218         {
219             get
220             {
221                 return appId;
222             }
223             set
224             {
225                 Interop.WebContext.SetAppId(SwigCPtr, value);
226                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227                 appId = value;
228             }
229         }
230
231         /// <summary>
232         /// App version.
233         /// </summary>
234         [EditorBrowsable(EditorBrowsableState.Never)]
235         public string AppVersion
236         {
237             get
238             {
239                 return appVersion;
240             }
241             set
242             {
243                 Interop.WebContext.SetAppVersion(SwigCPtr, value);
244                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245                 appVersion = value;
246             }
247         }
248
249         /// <summary>
250         /// App type.
251         /// </summary>
252         [EditorBrowsable(EditorBrowsableState.Never)]
253         public ApplicationType AppType
254         {
255             get
256             {
257                 return applicationType;
258             }
259             set
260             {
261                 Interop.WebContext.SetApplicationType(SwigCPtr, (int)value);
262                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263                 applicationType = value;
264             }
265         }
266
267         /// <summary>
268         /// Time offset.
269         /// </summary>
270         [EditorBrowsable(EditorBrowsableState.Never)]
271         public float TimeOffset
272         {
273             get
274             {
275                 return timeOffset;
276             }
277             set
278             {
279                 Interop.WebContext.SetTimeOffset(SwigCPtr, value);
280                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281                 timeOffset = value;
282             }
283         }
284
285         /// <summary>
286         /// Default zoom factor.
287         /// </summary>
288         [EditorBrowsable(EditorBrowsableState.Never)]
289         public float DefaultZoomFactor
290         {
291             get
292             {
293                 return Interop.WebContext.GetDefaultZoomFactor(SwigCPtr);
294             }
295             set
296             {
297                 Interop.WebContext.SetDefaultZoomFactor(SwigCPtr, value);
298                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299             }
300         }
301
302         /// <summary>
303         /// Deprecated. Gets context proxy.
304         /// </summary>
305         [EditorBrowsable(EditorBrowsableState.Never)]
306         public string ContextProxy
307         {
308             get
309             {
310                 return Interop.WebContext.GetProxyUri(SwigCPtr);
311             }
312         }
313
314         /// <summary>
315         /// Gets proxy bypass rule.
316         /// </summary>
317         [EditorBrowsable(EditorBrowsableState.Never)]
318         public string ProxyBypassRule
319         {
320             get
321             {
322                 return Interop.WebContext.GetProxyBypassRule(SwigCPtr);
323             }
324         }
325
326         /// <summary>
327         /// Sets default proxy auth.
328         /// </summary>
329         [EditorBrowsable(EditorBrowsableState.Never)]
330         public void SetDefaultProxyAuth(string username, string password)
331         {
332             Interop.WebContext.SetDefaultProxyAuth(SwigCPtr, username, password);
333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334         }
335
336         /// <summary>
337         /// Deletes all web database.
338         /// </summary>
339         [EditorBrowsable(EditorBrowsableState.Never)]
340         public void DeleteAllWebDatabase()
341         {
342             Interop.WebContext.DeleteAllWebDatabase(SwigCPtr);
343             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344         }
345
346         /// <summary>
347         /// Gets security origins of web database asynchronously.
348         /// <param name="callback">callback for acquiring security origins</param>
349         /// </summary>
350         [EditorBrowsable(EditorBrowsableState.Never)]
351         public bool GetWebDatabaseOrigins(SecurityOriginListAcquiredCallback callback)
352         {
353             securityOriginListAcquiredCallback = callback;
354             IntPtr ip = Marshal.GetFunctionPointerForDelegate(securityOriginListAcquiredProxyCallback);
355             bool result = Interop.WebContext.GetWebDatabaseOrigins(SwigCPtr, new HandleRef(this, ip));
356             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357             return result;
358         }
359
360         /// <summary>
361         /// Deletes web databases by origin.
362         /// <param name="origin">security origin of web database</param>
363         /// </summary>
364         [EditorBrowsable(EditorBrowsableState.Never)]
365         public bool DeleteWebDatabase(WebSecurityOrigin origin)
366         {
367             bool result = Interop.WebContext.DeleteWebDatabase(SwigCPtr, WebSecurityOrigin.getCPtr(origin));
368             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369             return result;
370         }
371
372         /// <summary>
373         /// Gets a list of security origins of web storage asynchronously.
374         /// <param name="callback">callback for acquiring security origins</param>
375         /// </summary>
376         [EditorBrowsable(EditorBrowsableState.Never)]
377         public bool GetWebStorageOrigins(SecurityOriginListAcquiredCallback callback)
378         {
379             securityOriginListAcquiredCallback = callback;
380             IntPtr ip = Marshal.GetFunctionPointerForDelegate(securityOriginListAcquiredProxyCallback);
381             bool result = Interop.WebContext.GetWebStorageOrigins(SwigCPtr, new HandleRef(this, ip));
382             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
383             return result;
384         }
385
386         /// <summary>
387         /// Gets a list of security origins of web storage asynchronously.
388         /// <param name="origin">security origin of web storage</param>
389         /// <param name="callback">callback for acquiring storage usage</param>
390         /// </summary>
391         [EditorBrowsable(EditorBrowsableState.Never)]
392         public bool GetWebStorageUsageForOrigin(WebSecurityOrigin origin, StorageUsageAcquiredCallback callback)
393         {
394             IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
395             bool result = Interop.WebContext.GetWebStorageUsageForOrigin(SwigCPtr, WebSecurityOrigin.getCPtr(origin), new HandleRef(this, ip));
396             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
397             return result;
398         }
399
400         /// <summary>
401         /// Deletes all web storage.
402         /// </summary>
403         [EditorBrowsable(EditorBrowsableState.Never)]
404         public void DeleteAllWebStorage()
405         {
406             Interop.WebContext.DeleteAllWebStorage(SwigCPtr);
407             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408         }
409
410         /// <summary>
411         /// Deletes web storage by origin.
412         /// <param name="origin">security origin of web storage</param>
413         /// </summary>
414         [EditorBrowsable(EditorBrowsableState.Never)]
415         public bool DeleteWebStorage(WebSecurityOrigin origin)
416         {
417             bool result = Interop.WebContext.DeleteWebStorage(SwigCPtr, WebSecurityOrigin.getCPtr(origin));
418             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
419             return result;
420         }
421
422         /// <summary>
423         /// Deletes local fileSystem.
424         /// </summary>
425         [EditorBrowsable(EditorBrowsableState.Never)]
426         public void DeleteLocalFileSystem()
427         {
428             Interop.WebContext.DeleteLocalFileSystem(SwigCPtr);
429             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430         }
431
432         /// <summary>
433         /// Clears cache.
434         /// </summary>
435         [EditorBrowsable(EditorBrowsableState.Never)]
436         public void ClearCache()
437         {
438             Interop.WebContext.ClearCache(SwigCPtr);
439             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440         }
441
442         /// <summary>
443         /// Deletes web application cache by origin.
444         /// <param name="origin">security origin of web application</param>
445         /// </summary>
446         [EditorBrowsable(EditorBrowsableState.Never)]
447         public bool DeleteApplicationCache(WebSecurityOrigin origin)
448         {
449             bool result = Interop.WebContext.DeleteApplicationCache(SwigCPtr, WebSecurityOrigin.getCPtr(origin));
450             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451             return result;
452         }
453
454         /// <summary>
455         /// Gets a list of all password data asynchronously.
456         /// <param name="callback">callback for acquiring password data list</param>
457         /// </summary>
458         [EditorBrowsable(EditorBrowsableState.Never)]
459         public void GetFormPasswordList(PasswordDataListAcquiredCallback callback)
460         {
461             passwordDataListAcquiredCallback = callback;
462             IntPtr ip = Marshal.GetFunctionPointerForDelegate(passwordDataListAcquiredProxyCallback);
463             Interop.WebContext.GetFormPasswordList(SwigCPtr, new HandleRef(this, ip));
464             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465         }
466
467         /// <summary>
468         /// Registers callback for download started.
469         /// <param name="callback">callback for download started</param>
470         /// </summary>
471         [EditorBrowsable(EditorBrowsableState.Never)]
472         public void RegisterDownloadStartedCallback(DownloadStartedCallback callback)
473         {
474             IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
475             Interop.WebContext.RegisterDownloadStartedCallback(SwigCPtr, new HandleRef(this, ip));
476             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
477         }
478
479         /// <summary>
480         /// Registers callback for overriding mime type.
481         /// <param name="callback">callback for overriding mime type</param>
482         /// </summary>
483         [EditorBrowsable(EditorBrowsableState.Never)]
484         public void RegisterMimeOverriddenCallback(MimeOverriddenCallback callback)
485         {
486             IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback);
487             Interop.WebContext.RegisterMimeOverriddenCallback(SwigCPtr, new HandleRef(this, ip));
488             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
489         }
490
491         /// <summary>
492         /// Sets context time zone offset.
493         /// <param name="offset">Time offset</param>
494         /// <param name="time">Daylight saving time</param>
495         /// </summary>
496         [EditorBrowsable(EditorBrowsableState.Never)]
497         public void SetTimeZoneOffset(float offset, float time)
498         {
499             Interop.WebContext.SetTimeZoneOffset(SwigCPtr, offset, time);
500             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
501         }
502
503         /// <summary>
504         /// Deprecated. Sets context time zone offset.
505         /// <param name="offset">Time offset</param>
506         /// <param name="time">Daylight saving time</param>
507         /// </summary>
508         [EditorBrowsable(EditorBrowsableState.Never)]
509         public void SetContextTimeZoneOffset(float offset, float time)
510         {
511             SetTimeZoneOffset(offset, time);
512         }
513
514         /// <summary>
515         /// Registers url schemes enabled.
516         /// <param name="schemes">The string array of schemes</param>
517         /// </summary>
518         [EditorBrowsable(EditorBrowsableState.Never)]
519         public void RegisterUrlSchemesAsCorsEnabled(string[] schemes)
520         {
521             if (schemes != null)
522             {
523                 Interop.WebContext.RegisterUrlSchemesAsCorsEnabled(SwigCPtr, schemes, (uint)schemes.Length);
524                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525             }
526         }
527
528         /// <summary>
529         /// Registers js plugin mime types.
530         /// <param name="mimes">The string array of types</param>
531         /// </summary>
532         [EditorBrowsable(EditorBrowsableState.Never)]
533         public void RegisterJsPluginMimeTypes(string[] mimes)
534         {
535             if (mimes != null)
536             {
537                 Interop.WebContext.RegisterJsPluginMimeTypes(SwigCPtr, mimes, (uint)mimes.Length);
538                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
539             }
540         }
541
542         /// <summary>
543         /// Deletes all application cache.
544         /// </summary>
545         [EditorBrowsable(EditorBrowsableState.Never)]
546         public bool DeleteAllApplicationCache()
547         {
548             bool ret = Interop.WebContext.DeleteAllApplicationCache(SwigCPtr);
549             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
550             return ret;
551         }
552
553         /// <summary>
554         /// Deletes all web indexed database.
555         /// </summary>
556         [EditorBrowsable(EditorBrowsableState.Never)]
557         public bool DeleteAllWebIndexedDatabase()
558         {
559             bool ret = Interop.WebContext.DeleteAllWebIndexedDatabase(SwigCPtr);
560             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561             return ret;
562         }
563
564         /// <summary>
565         /// Deletes password dataList.
566         /// <param name="passwords">The string array of data list</param>
567         /// </summary>
568         [EditorBrowsable(EditorBrowsableState.Never)]
569         public void DeleteFormPasswordDataList(string[] passwords)
570         {
571             if (passwords != null)
572             {
573                 Interop.WebContext.DeleteFormPasswordDataList(SwigCPtr, passwords, (uint)passwords.Length);
574                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575             }
576         }
577
578         /// <summary>
579         /// Deletes all password data.
580         /// </summary>
581         [EditorBrowsable(EditorBrowsableState.Never)]
582         public void DeleteAllFormPasswordData()
583         {
584             Interop.WebContext.DeleteAllFormPasswordData(SwigCPtr);
585             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586         }
587
588         /// <summary>
589         /// Deletes all candidate data.
590         /// </summary>
591         [EditorBrowsable(EditorBrowsableState.Never)]
592         public void DeleteAllFormCandidateData()
593         {
594             Interop.WebContext.DeleteAllFormCandidateData(SwigCPtr);
595             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596         }
597
598         /// <summary>
599         /// Sets proxy bypass rule.
600         /// <param name="proxy">The proxy string</param>
601         /// <param name="rule">Bypass rule</param>
602         /// </summary>
603         [EditorBrowsable(EditorBrowsableState.Never)]
604         public void SetProxyBypassRule(string proxy, string rule)
605         {
606             Interop.WebContext.SetProxyBypassRule(SwigCPtr, proxy, rule);
607             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608         }
609
610         /// <summary>
611         /// Deprecated. Sets proxy bypass rule.
612         /// <param name="proxy">The proxy string</param>
613         /// <param name="rule">Bypass rule</param>
614         /// </summary>
615         [EditorBrowsable(EditorBrowsableState.Never)]
616         public void SetContextProxy(string proxy, string rule)
617         {
618             SetProxyBypassRule(proxy, rule);
619         }
620
621         /// <summary>
622         /// Frees unused memory.
623         /// </summary>
624         [EditorBrowsable(EditorBrowsableState.Never)]
625         public bool FreeUnusedMemory()
626         {
627             bool ret = Interop.WebContext.FreeUnusedMemory(SwigCPtr);
628             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629             return ret;
630         }
631
632         private void OnSecurityOriginListAcquired(IntPtr list)
633         {
634             WebSecurityOriginList originList = new WebSecurityOriginList(list, true);
635             securityOriginListAcquiredCallback?.Invoke(originList);
636             originList.Dispose();
637         }
638
639         private void OnPasswordDataListAcquired(IntPtr list)
640         {
641             WebPasswordDataList passwordList = new WebPasswordDataList(list, true);
642             passwordDataListAcquiredCallback?.Invoke(passwordList);
643             passwordList.Dispose();
644         }
645     }
646 }