Add some APIs into web context. 38/254838/6
authorhuayong.xu <huayong.xu@samsung.com>
Fri, 2 Apr 2021 11:18:33 +0000 (19:18 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Tue, 6 Apr 2021 12:14:58 +0000 (20:14 +0800)
This patch is to add some APIs with callbacks into web context.

Change-Id: I234c433a169569b944162edf5f8d4ac34733dacb

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp
dali-toolkit/devel-api/controls/web-view/web-context.cpp
dali-toolkit/devel-api/controls/web-view/web-context.h [changed mode: 0644->0755]

index 14f2c1f..b33e169 100755 (executable)
@@ -30,6 +30,7 @@
 #include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
 #include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
 #include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
 #include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/images/pixel-data.h>
@@ -49,14 +50,16 @@ namespace Adaptor
 {
 
 class WebEngine;
 {
 
 class WebEngine;
+class MockWebEngineContext;
 
 namespace
 {
 
 // Generally only one WebEngine instance exists.
 // If > 1, a new web engine has been created by CreateWindowSignal.
 
 namespace
 {
 
 // Generally only one WebEngine instance exists.
 // If > 1, a new web engine has been created by CreateWindowSignal.
-static WebEngine* gInstance = 0;
+static WebEngine* gInstance = nullptr;
 static int gInstanceCount = 0;
 static int gInstanceCount = 0;
+static MockWebEngineContext* gWebEngineContextInstance = nullptr;
 
 bool OnGoBack();
 bool OnGoForward();
 
 bool OnGoBack();
 bool OnGoForward();
@@ -70,6 +73,11 @@ bool OnScreenshotCaptured();
 bool OnVideoPlaying();
 bool OnGeolocationPermission();
 bool OnClearHistory();
 bool OnVideoPlaying();
 bool OnGeolocationPermission();
 bool OnClearHistory();
+bool OnSecurityOriginAcquired();
+bool OnStorageUsageAcquired();
+bool OnFormPasswordAcquired();
+bool OnDownloadStarted();
+bool OnMimeOverridden();
 
 static void ConnectToGlobalSignal( bool ( *func )() )
 {
 
 static void ConnectToGlobalSignal( bool ( *func )() )
 {
@@ -114,12 +122,52 @@ public:
   {
   }
 
   {
   }
 
-  void DeleteWebDatabase() override
+  void DeleteAllWebDatabase() override
   {
   }
 
   {
   }
 
-  void DeleteWebStorage() override
+  bool GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
   {
   {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnSecurityOriginAcquired);
+      mSecurityOriginAcquiredCallback = callback;
+    }
+    return true;
+  }
+
+  bool DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
+  {
+    return true;
+  }
+
+  bool GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnSecurityOriginAcquired);
+      mSecurityOriginAcquiredCallback = callback;
+    }
+    return true;
+  }
+
+  bool GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback) 
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnStorageUsageAcquired);
+      mStorageUsageAcquiredCallback = callback;
+    }
+    return true;
+  }
+
+  void DeleteAllWebStorage() override
+  {
+  }
+
+  bool DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin)
+  {
+    return true;
   }
 
   void DeleteLocalFileSystem() override
   }
 
   void DeleteLocalFileSystem() override
@@ -134,10 +182,73 @@ public:
   {
   }
 
   {
   }
 
+  bool DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
+  {
+    return true;
+  }
+
+  void GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnFormPasswordAcquired);
+      mFormPasswordAcquiredCallback = callback;
+    }
+  }
+
+  void RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnDownloadStarted);
+      mDownloadStartedCallback = callback;
+    }
+  }
+
+  void RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnMimeOverridden);
+      mMimeOverriddenCallback = callback;
+    }
+  }
+
+public:
+  Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback mSecurityOriginAcquiredCallback;
+  Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback mStorageUsageAcquiredCallback;
+  Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback mFormPasswordAcquiredCallback;
+  Dali::WebEngineContext::WebEngineDownloadStartedCallback mDownloadStartedCallback;
+  Dali::WebEngineContext::WebEngineMimeOverriddenCallback mMimeOverriddenCallback;
+
 private:
   Dali::WebEngineContext::CacheModel mockModel;
 };
 
 private:
   Dali::WebEngineContext::CacheModel mockModel;
 };
 
+class MockWebEngineSecurityOrigin : public Dali::WebEngineSecurityOrigin
+{
+public:
+  MockWebEngineSecurityOrigin()
+    : mockUrl("https://test.html")
+    , mockPotocol("https")
+  {
+  }
+
+  std::string GetHost() const
+  {
+    return mockUrl;
+  }
+
+  std::string GetProtocol() const
+  {
+    return mockPotocol;
+  }
+
+private:
+  std::string mockUrl;
+  std::string mockPotocol;
+};
+
 class MockWebEngineCookieManager : public Dali::WebEngineCookieManager
 {
 public:
 class MockWebEngineCookieManager : public Dali::WebEngineCookieManager
 {
 public:
@@ -718,7 +829,12 @@ public:
     }
 
     mockWebEngineSettings = new MockWebEngineSettings();
     }
 
     mockWebEngineSettings = new MockWebEngineSettings();
-    mockWebEngineContext = new MockWebEngineContext();
+    MockWebEngineContext* engineContext = new MockWebEngineContext();
+    mockWebEngineContext = engineContext;
+    if ( gInstanceCount == 1 )
+    {
+      gWebEngineContextInstance = engineContext;
+    }
     mockWebEngineCookieManager = new MockWebEngineCookieManager();
     mockWebEngineBackForwardList = new MockWebEngineBackForwardList();
   }
     mockWebEngineCookieManager = new MockWebEngineCookieManager();
     mockWebEngineBackForwardList = new MockWebEngineBackForwardList();
   }
@@ -729,6 +845,7 @@ public:
     if( !gInstanceCount )
     {
       gInstance = 0;
     if( !gInstanceCount )
     {
       gInstance = 0;
+      gWebEngineContextInstance = 0;
     }
 
     delete mockWebEngineSettings;
     }
 
     delete mockWebEngineSettings;
@@ -1271,6 +1388,65 @@ bool OnClearHistory()
   return false;
 }
 
   return false;
 }
 
+bool OnSecurityOriginAcquired()
+{
+  DisconnectFromGlobalSignal(&OnSecurityOriginAcquired);
+  if (gWebEngineContextInstance)
+  {
+    std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> securityOriginList;
+    std::unique_ptr<Dali::WebEngineSecurityOrigin> origin(new MockWebEngineSecurityOrigin());
+    securityOriginList.push_back(std::move(origin));
+    gWebEngineContextInstance->mSecurityOriginAcquiredCallback(securityOriginList);
+  }
+  return false;
+}
+
+bool OnStorageUsageAcquired()
+{
+  DisconnectFromGlobalSignal(&OnStorageUsageAcquired);
+  if (gWebEngineContextInstance)
+  {
+    gWebEngineContextInstance->mStorageUsageAcquiredCallback(0);
+  }
+  return false;
+}
+
+bool OnFormPasswordAcquired()
+{
+  DisconnectFromGlobalSignal(&OnFormPasswordAcquired);
+  if (gWebEngineContextInstance)
+  {
+    std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> formPasswordList;
+    std::unique_ptr<Dali::WebEngineContext::PasswordData> data(new Dali::WebEngineContext::PasswordData());
+    data->url = "http://test.html";
+    data->useFingerprint = false;
+    formPasswordList.push_back(std::move(data));
+    gWebEngineContextInstance->mFormPasswordAcquiredCallback(formPasswordList);
+  }
+  return false;
+}
+
+bool OnDownloadStarted()
+{
+  DisconnectFromGlobalSignal(&OnDownloadStarted);
+  if (gWebEngineContextInstance)
+  {
+    gWebEngineContextInstance->mDownloadStartedCallback("http://test.html");
+  }
+  return false;
+}
+
+bool OnMimeOverridden()
+{
+  DisconnectFromGlobalSignal(&OnMimeOverridden);
+  if (gWebEngineContextInstance)
+  {
+    std::string newMime;
+    gWebEngineContextInstance->mMimeOverriddenCallback("http://test.html", "txt/xml", newMime);
+  }
+  return false;
+}
+
 } // namespace
 
 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
 } // namespace
 
 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
index 034e377..0d254ab 100755 (executable)
@@ -29,6 +29,8 @@
 #include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
 #include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
 #include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
 #include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
@@ -85,6 +87,13 @@ static int gSslCertificateChangedCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
 static int gHttpAuthHandlerCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
 static std::shared_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
 static int gHttpAuthHandlerCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
+static int gSecurityOriginsAcquiredCallbackCalled = 0;
+static int gStorageUsageAcquiredCallbackCalled = 0;
+static int gFormPasswordsAcquiredCallbackCalled = 0;
+static int gDownloadStartedCallbackCalled = 0;
+static int gMimeOverriddenCallbackCalled = 0;
+static std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> gSecurityOriginList;
+static std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> gPasswordDataList;
 
 struct CallbackFunctor
 {
 
 struct CallbackFunctor
 {
@@ -162,7 +171,7 @@ static bool OnJavaScriptPrompt( const std::string& meesage1, const std::string&
 
 static void OnScreenshotCaptured(Dali::Toolkit::ImageView)
 {
 
 static void OnScreenshotCaptured(Dali::Toolkit::ImageView)
 {
-  gScreenshotCapturedCallbackCalled++;\r
+  gScreenshotCapturedCallbackCalled++;
 }
 
 static void OnVideoPlaying(bool isPlaying)
 }
 
 static void OnVideoPlaying(bool isPlaying)
@@ -235,6 +244,36 @@ static void OnHttpAuthHandler( WebView view, std::shared_ptr<Dali::WebEngineHttp
   gHttpAuthInstance = std::move(hander);
 }
 
   gHttpAuthInstance = std::move(hander);
 }
 
+static void OnSecurityOriginsAcquired(std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>>& origins)
+{
+  gSecurityOriginsAcquiredCallbackCalled++;
+  gSecurityOriginList.clear();
+  gSecurityOriginList.swap(origins);
+}
+
+static void OnStorageUsageAcquired(uint64_t usage)
+{
+  gStorageUsageAcquiredCallbackCalled++;
+}
+
+static void OnFormPasswordsAcquired(std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>>& passwords)
+{
+  gFormPasswordsAcquiredCallbackCalled++;
+  gPasswordDataList.clear();
+  gPasswordDataList.swap(passwords);
+}
+
+static void OnDownloadStarted(const std::string& url)
+{
+  gDownloadStartedCallbackCalled++;
+}
+
+static bool OnMimeOverridden(const std::string&, const std::string&, std::string&)
+{
+  gMimeOverriddenCallbackCalled++;
+  return false;
+}
+
 } // namespace
 
 void web_view_startup(void)
 } // namespace
 
 void web_view_startup(void)
@@ -1398,8 +1437,8 @@ int UtcDaliWebContextGetSetCacheModel(void)
   context->SetCertificateFilePath( kDefaultValue );
   context->DisableCache( false );
   context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
   context->SetCertificateFilePath( kDefaultValue );
   context->DisableCache( false );
   context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
-  context->DeleteWebDatabase();
-  context->DeleteWebStorage();
+  context->DeleteAllWebDatabase();
+  context->DeleteAllWebStorage();
   context->DeleteLocalFileSystem();
   context->ClearCache();
 
   context->DeleteLocalFileSystem();
   context->ClearCache();
 
@@ -1415,6 +1454,76 @@ int UtcDaliWebContextGetSetCacheModel(void)
   END_TEST;
 }
 
   END_TEST;
 }
 
+int UtcDaliWebContextGetWebDatabaseStorageOrigins(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebContext* context = view.GetContext();
+  DALI_TEST_CHECK( context != 0 )
+
+  std::string kDefaultValue;
+
+  // get origins of web database
+  bool result = context->GetWebDatabaseOrigins(&OnSecurityOriginsAcquired);
+  DALI_TEST_CHECK( result );
+
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
+
+  Dali::WebEngineSecurityOrigin* origin = gSecurityOriginList[0].get();
+  DALI_TEST_CHECK( origin );
+
+  result = context->DeleteWebDatabase(*origin);
+  DALI_TEST_CHECK( result );
+
+  // get origins of web storage
+  result = context->GetWebStorageOrigins(&OnSecurityOriginsAcquired);
+  DALI_TEST_CHECK( result );
+
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 2, TEST_LOCATION );
+  DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
+
+  origin = gSecurityOriginList[0].get();
+  DALI_TEST_CHECK( origin );
+
+  result = context->GetWebStorageUsageForOrigin(*origin, &OnStorageUsageAcquired);
+  DALI_TEST_CHECK( result );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gStorageUsageAcquiredCallbackCalled, 1, TEST_LOCATION );
+
+  result = context->DeleteWebStorageOrigin(*origin);
+  DALI_TEST_CHECK( result );
+
+  result = context->DeleteApplicationCache(*origin);
+  DALI_TEST_CHECK( result );
+
+  // form passwords, download state, mime type.
+  context->GetFormPasswordList(&OnFormPasswordsAcquired);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gFormPasswordsAcquiredCallbackCalled, 1, TEST_LOCATION);
+  DALI_TEST_CHECK(gPasswordDataList.size() == 1);
+  DALI_TEST_EQUALS(gPasswordDataList[0]->url, "http://test.html", TEST_LOCATION);
+  DALI_TEST_CHECK(gPasswordDataList[0]->useFingerprint == false);
+
+  context->RegisterDownloadStartedCallback(&OnDownloadStarted);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gDownloadStartedCallbackCalled, 1, TEST_LOCATION);
+
+  context->RegisterMimeOverriddenCallback(&OnMimeOverridden);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gMimeOverriddenCallbackCalled, 1, TEST_LOCATION);
+
+  gSecurityOriginList.clear();
+  gPasswordDataList.clear();
+
+  END_TEST;
+}
+
 // test cases for web cookie manager.
 
 int UtcDaliWebCookieManagerGetSetCookieAcceptPolicy(void)
 // test cases for web cookie manager.
 
 int UtcDaliWebCookieManagerGetSetCookieAcceptPolicy(void)
index c72012c..413f5ca 100644 (file)
@@ -18,6 +18,9 @@
 // CLASS HEADER
 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
 
 // CLASS HEADER
 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
+
 namespace Dali
 {
 namespace Toolkit
 namespace Dali
 {
 namespace Toolkit
@@ -61,14 +64,39 @@ void WebContext::SetDefaultProxyAuth(const std::string& username, const std::str
   mWebEngineContext.SetDefaultProxyAuth(username, password);
 }
 
   mWebEngineContext.SetDefaultProxyAuth(username, password);
 }
 
-void WebContext::DeleteWebDatabase()
+void WebContext::DeleteAllWebDatabase()
+{
+  mWebEngineContext.DeleteAllWebDatabase();
+}
+
+bool WebContext::GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
 {
 {
-  mWebEngineContext.DeleteWebDatabase();
+  return mWebEngineContext.GetWebDatabaseOrigins(callback);
 }
 
 }
 
-void WebContext::DeleteWebStorage()
+bool WebContext::DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
 {
 {
-  mWebEngineContext.DeleteWebStorage();
+  return mWebEngineContext.DeleteWebDatabase(origin);
+}
+
+bool WebContext::GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
+{
+  return mWebEngineContext.GetWebStorageOrigins(callback);
+}
+
+bool WebContext::GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback)
+{
+  return mWebEngineContext.GetWebStorageUsageForOrigin(origin, callback);
+}
+
+void WebContext::DeleteAllWebStorage()
+{
+  mWebEngineContext.DeleteAllWebStorage();
+}
+
+bool WebContext::DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin)
+{
+  return mWebEngineContext.DeleteWebStorageOrigin(origin);
 }
 
 void WebContext::DeleteLocalFileSystem()
 }
 
 void WebContext::DeleteLocalFileSystem()
@@ -81,6 +109,25 @@ void WebContext::ClearCache()
   mWebEngineContext.ClearCache();
 }
 
   mWebEngineContext.ClearCache();
 }
 
-} // namespace Toolkit
+bool WebContext::DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
+{
+  return mWebEngineContext.DeleteApplicationCache(origin);
+}
+
+void WebContext::GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
+{
+  mWebEngineContext.GetFormPasswordList(callback);
+}
 
 
+void WebContext::RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
+{
+  mWebEngineContext.RegisterDownloadStartedCallback(callback);
+}
+
+void WebContext::RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
+{
+  mWebEngineContext.RegisterMimeOverriddenCallback(callback);
+}
+
+} // namespace Toolkit
 } // namespace Dali
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index ead4efd..cdf7f0e
@@ -27,6 +27,8 @@
 
 namespace Dali
 {
 
 namespace Dali
 {
+class WebEngineSecurityOrigin;
+
 namespace Toolkit
 {
 /**
 namespace Toolkit
 {
 /**
@@ -35,16 +37,16 @@ namespace Toolkit
  */
 
 /**
  */
 
 /**
- * @brief WebContext is a control for settings of WebView.
+ * @brief WebContext is a control for context of WebView.
  *
  *
- * For working WebContext, a WebView should be provided.
+ * For working WebContext, a WebEngineContext should be provided.
  *
  */
 class DALI_TOOLKIT_API WebContext
 {
 public:
   /**
  *
  */
 class DALI_TOOLKIT_API WebContext
 {
 public:
   /**
-   * @brief Creates a WebContext.
+   * @brief Create a WebContext.
    *
    * @param[in] context The context of web engine.
    */
    *
    * @param[in] context The context of web engine.
    */
@@ -56,28 +58,28 @@ public:
   virtual ~WebContext() final;
 
   /**
   virtual ~WebContext() final;
 
   /**
-   * @brief Returns the cache model type.
+   * @brief Return the cache model type.
    *
    * @return #Dali::WebEngineContext::CacheModel
    */
   Dali::WebEngineContext::CacheModel GetCacheModel() const;
 
   /**
    *
    * @return #Dali::WebEngineContext::CacheModel
    */
   Dali::WebEngineContext::CacheModel GetCacheModel() const;
 
   /**
-   * @brief Requests to set the cache model.
+   * @brief Request to set the cache model.
    *
    * @param[in] cacheModel The cache model
    */
   void SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel);
 
   /**
    *
    * @param[in] cacheModel The cache model
    */
   void SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel);
 
   /**
-   * @brief Sets the given proxy URI to network backend of specific context.
+   * @brief Set the given proxy URI to network backend of specific context.
    *
    * @param[in] uri The proxy URI to set
    */
   void SetProxyUri(const std::string& uri);
 
   /**
    *
    * @param[in] uri The proxy URI to set
    */
   void SetProxyUri(const std::string& uri);
 
   /**
-   * Adds CA certificates to persistent NSS certificate database
+   * @brief Add CA certificates to persistent NSS certificate database
    *
    * Function accepts a path to a CA certificate file, a path to a directory
    * containing CA certificate files, or a colon-seprarated list of those.
    *
    * Function accepts a path to a CA certificate file, a path to a directory
    * containing CA certificate files, or a colon-seprarated list of those.
@@ -89,7 +91,7 @@ public:
   void SetCertificateFilePath(const std::string& certificatePath);
 
   /**
   void SetCertificateFilePath(const std::string& certificatePath);
 
   /**
-   * Toggles the cache to be enabled or disabled
+   * @brief Toggle the cache to be enabled or disabled
    *
    * Function works asynchronously.
    * By default the cache is disabled resulting in not storing network data on disk.
    *
    * Function works asynchronously.
    * By default the cache is disabled resulting in not storing network data on disk.
@@ -99,7 +101,7 @@ public:
   void DisableCache(bool cacheDisabled);
 
   /**
   void DisableCache(bool cacheDisabled);
 
   /**
-   * @brief Sets a proxy auth credential to network backend of specific context.
+   * @brief Set a proxy auth credential to network backend of specific context.
    *
    * @param[in] username username to set
    * @param[in] password password to set
    *
    * @param[in] username username to set
    * @param[in] password password to set
@@ -107,20 +109,66 @@ public:
   void SetDefaultProxyAuth(const std::string& username, const std::string& password);
 
   /**
   void SetDefaultProxyAuth(const std::string& username, const std::string& password);
 
   /**
-   * Requests for deleting all web databases.
+   * @brief Requests for deleting all web databases.
+   */
+  void DeleteAllWebDatabase();
+
+  /**
+   * @brief Request for getting web database origins.
+   *
+   * @param[in] callback callback called after getting web database origins
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback);
+
+  /**
+   * @brief Request for deleting web databases for origin.
+   *
+   * @param[in] origin database origin
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin);
+
+  /**
+   * @brief Gets list of origins that is stored in web storage db.
+   *
+   * @param[in] callback callback called after getting web storage origins
+   *
+   * @return true if succeeded, false otherwise
    */
    */
-  void DeleteWebDatabase();
+  bool GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback);
 
   /**
 
   /**
-   * @brief Deletes web storage.
+   * @brief Get list of origins that is stored in web storage db.
+   *
+   * @param[in] origin storage origin
+   * @param[in] callback callback called after getting web storage origins
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback);
+
+  /**
+   * @brief Delete all web storage.
    *
    * @details This function does not ensure that all data will be removed.
    *          Should be used to extend free physical memory.
    */
    *
    * @details This function does not ensure that all data will be removed.
    *          Should be used to extend free physical memory.
    */
-  void DeleteWebStorage();
+  void DeleteAllWebStorage();
 
   /**
 
   /**
-   * @brief Requests for deleting all local file systems.
+   * @brief Delete origin that is stored in web storage db.
+   *
+   * @param[in] origin origin of db
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin);
+
+  /**
+   * @brief Request for deleting all local file systems.
    */
   void DeleteLocalFileSystem();
 
    */
   void DeleteLocalFileSystem();
 
@@ -129,6 +177,36 @@ public:
    */
   void ClearCache();
 
    */
   void ClearCache();
 
+  /**
+   * @brief Request for deleting web application cache for origin.
+   *
+   * @param[in] origin application cache origin
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin);
+
+  /**
+   * @brief Asynchronous request to get list of all password data.
+   *
+   * @param[in] callback callback called after getting form password
+   */
+  void GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback);
+
+  /**
+   * @brief Register callback for download started.
+   *
+   * @param[in] callback callback for download started
+   */
+  void RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback);
+
+  /**
+   * @brief Register callback for mime overridden.
+   *
+   * @param[in] callback callback for mime overridden
+   */
+  void RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback);
+
 private:
   Dali::WebEngineContext& mWebEngineContext;
 };
 private:
   Dali::WebEngineContext& mWebEngineContext;
 };