CookieManager has member pointer into URLRequestContextGetter (request_context_getter_),
but because of the way objects of these classes were created, this pointer was never
properly initialized (it was always set to NULL). This patch makes it initialize properly.
Reviewed by: Daniel Waślicki, Janusz Majnert, Kamil Klimek, Piotr Tworek, SeungSeop Park
Change-Id: I1b55be86288b82d34bc34edc1970c84c0a60af15
Signed-off-by: Wojciech Wiśniewski <w.wisniewski@samsung.com>
#include "cookie_manager.h"
-namespace content {
-class URLRequestCOntextGetterEfl;
-}
-
class Ewk_Cookie_Manager {
public:
- static Ewk_Cookie_Manager* create(content::URLRequestContextGetterEfl* request_context_getter) {
- return (new Ewk_Cookie_Manager(request_context_getter));
+ static Ewk_Cookie_Manager* create() {
+ return new Ewk_Cookie_Manager;
}
~Ewk_Cookie_Manager() { }
}
private:
- explicit Ewk_Cookie_Manager(content::URLRequestContextGetterEfl* request_context_getter)
- : cookie_manager_(new CookieManager(request_context_getter)) {
+ Ewk_Cookie_Manager()
+ : cookie_manager_(new CookieManager) {
}
scoped_refptr<CookieManager> cookie_manager_;
void* user_data_;
};
-CookieManager::CookieManager(content::URLRequestContextGetterEfl* request_context_getter)
+CookieManager::CookieManager()
: is_clearing_(false),
- request_context_getter_(request_context_getter),
cookie_policy_(TW_COOKIE_ACCEPT_POLICY_ALWAYS)
{
}
+void CookieManager::SetRequestContextGetter(content::URLRequestContextGetterEfl* getter) {
+ request_context_getter_ = getter;
+}
+
void CookieManager::DeleteCookiesAsync(const std::string& url,
const std::string& cookie_name)
{
void *);
typedef void (*AsyncHostnamesGetCb)(Eina_List*, _Ewk_Error*, void *);
- explicit CookieManager(
- content::URLRequestContextGetterEfl* request_context_getter);
+ CookieManager();
// Delete all cookies that match the specified parameters. If both |url| and
// values |cookie_name| are specified all host and domain cookies matching
// both will be deleted. If only |url| is specified all host cookies (but not
bool ShouldBlockThirdPartyCookies();
//This is synchronous call
std::string GetCookiesForURL(const std::string& url);
-
+ void SetRequestContextGetter(content::URLRequestContextGetterEfl* getter);
private:
struct EwkGetHostCallback;
Ewk_Cookie_Manager* EWebContext::ewkCookieManager() {
if (!ewk_cookie_manager_)
- ewk_cookie_manager_.reset(Ewk_Cookie_Manager::create(browser_context_->GetRequestContextEfl()));
+ ewk_cookie_manager_.reset(Ewk_Cookie_Manager::create());
return ewk_cookie_manager_.get();
}
// Must first be created on the UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ cookie_manager_->SetRequestContextGetter(this);
+
if (protocol_handlers)
std::swap(protocol_handlers_, *protocol_handlers);