From d782c41930a9eca7b545336b64d981eb37f6827c Mon Sep 17 00:00:00 2001 From: Antonio Gomes Date: Fri, 8 Jan 2016 13:19:20 -0400 Subject: [PATCH] Fix ewk_cookie_manager_persistent_storage_set when called before a WebView Patch indirectly creates requestcontext, resourceContextEfl and cookiemanager instances as part of EWebContext ctor. These objects end up getting created as part of the EWebView::InitializeContents routine anyways. The reason on why it is manually triggered here is because there are ewk_cookie_manager APIs that can be called before a webview instance is created. In such circumstances, APIs fail to execute, including ewk_cookie_manager_persistent_storage_set. Also, patch sets file:// as a cookieable protocol for WRT purposes. Original beta/m47 patch: http://165.213.202.130/gerrit/#/c/102798/ Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=15514 Reviewed by: djmix.kim Change-Id: Ieffcbf1058237e032486aa3c715dbee1282304c9 Signed-off-by: Antonio Gomes --- tizen_src/ewk/efl_integration/eweb_context.cc | 11 +++++++++++ .../ewk/efl_integration/url_request_context_getter_efl.cc | 2 ++ 2 files changed, 13 insertions(+) diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index d3f0a53..8d41b73 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -244,6 +244,17 @@ EWebContext::EWebContext(bool incognito, const std::string& injectedBundlePath) // WRT does not really care about incognito, so set it to false browser_context_.reset(new BrowserContextEfl(this, incognito)); + + // This indirectly creates RequestContext, ResourceContextEfl + // and CookieManager instances associated to this context. + // These objects end up getting created as part of the + // EWebView::InitializeContents routine anyways. + // The reason on why it is manually triggered here is because + // there are ewk_cookie_manager APIs that can be called before a + // WebView instance is created. In such circumstances, APIs including + // ewk_cookie_manager_persistent_storage_set fail to execute. + browser_context_->GetRequestContext(); + // Notification Service gets init in BrowserMainRunner init, // so cache manager can register for notifications only after that. web_cache_manager_.reset(new WebCacheManagerEfl(browser_context_.get())); diff --git a/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc b/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc index 698132b..cbb8ee5 100644 --- a/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc +++ b/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc @@ -306,6 +306,7 @@ void URLRequestContextGetterEfl::CreateSQLitePersistentCookieStore( if (persistent_store.get() && persist_session_cookies) cookie_monster->SetPersistSessionCookies(true); + cookie_monster->SetEnableFileScheme(true); cookie_store_path_ = path; } @@ -323,6 +324,7 @@ void URLRequestContextGetterEfl::CreatePersistentCookieStore(const base::FilePat NULL); cookie_store_= CreateCookieStore(config); cookie_store_->GetCookieMonster()->SetPersistSessionCookies(persist_session_cookies); + cookie_store_->GetCookieMonster()->SetEnableFileScheme(true); DCHECK(url_request_context_); url_request_context_->set_cookie_store(cookie_store_.get()); } -- 2.7.4