Implement EWebContext::Delete
authorPiotr Sieduszewski <p.sieduszews@samsung.com>
Wed, 16 Apr 2014 13:25:37 +0000 (15:25 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Issue: CBWEBVIEW-226
Change-Id: Ic452609615301162d09944a36f68fffb8dd4330f

tizen_src/impl/eweb_context.cc
tizen_src/impl/eweb_context.h

index b70633c..f69ef2e 100644 (file)
@@ -232,6 +232,20 @@ EWebContext* EWebContext::DefaultContext() {
   return default_context_;
 }
 
+void EWebContext::Delete(EWebContext*const context) {
+  if (!context)
+    return;
+
+  if (context == default_context_ && context->HasOneRef()) {
+    // With chromium engine there is only single context
+    // which is default context hence this delete
+    // function will not be implemented
+    NOTIMPLEMENTED();
+    return;
+  }
+  context->Release();
+}
+
 EWebContext::EWebContext()
     : browser_context_(new BrowserContextEfl(this))
     , m_pixmap(0) {
@@ -244,6 +258,8 @@ EWebContext::EWebContext()
 
 EWebContext::~EWebContext() {
   VibrationProviderClient::DeleteInstance();
+  if (this == default_context_)
+    default_context_= NULL;
 }
 
 // static
index d0aaee2..83d7ea5 100644 (file)
@@ -60,6 +60,7 @@ class EWebContext : public EWebObject {
   EWebContext();
 
   static EWebContext* DefaultContext();
+  static void Delete(EWebContext*);
 
   content::BrowserContextEfl* browser_context() const { return browser_context_.get(); }