2015-02-14 00:17:08 +01:00
|
|
|
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_COOKIE_STORE_PROXY_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_COOKIE_STORE_PROXY_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "net/cookies/cookie_store.h"
|
|
|
|
|
2018-10-08 17:57:14 +02:00
|
|
|
class CefCookieStoreSource;
|
2015-02-14 00:17:08 +01:00
|
|
|
|
2018-10-08 17:57:14 +02:00
|
|
|
// Proxies cookie requests to a CefCookieStoreSource (see comments on the
|
|
|
|
// implementation classes for details). Only accessed on the IO thread.
|
2015-02-14 00:17:08 +01:00
|
|
|
class CefCookieStoreProxy : public net::CookieStore {
|
|
|
|
public:
|
2018-10-08 17:57:14 +02:00
|
|
|
explicit CefCookieStoreProxy(std::unique_ptr<CefCookieStoreSource> source);
|
2015-02-14 00:17:08 +01:00
|
|
|
~CefCookieStoreProxy() override;
|
|
|
|
|
|
|
|
// net::CookieStore methods.
|
2017-05-17 11:29:28 +02:00
|
|
|
void SetCookieWithOptionsAsync(const GURL& url,
|
|
|
|
const std::string& cookie_line,
|
|
|
|
const net::CookieOptions& options,
|
2017-07-27 01:19:27 +02:00
|
|
|
SetCookiesCallback callback) override;
|
|
|
|
void SetCanonicalCookieAsync(std::unique_ptr<net::CanonicalCookie> cookie,
|
|
|
|
bool secure_source,
|
|
|
|
bool modify_http_only,
|
|
|
|
SetCookiesCallback callback) override;
|
|
|
|
void GetCookieListWithOptionsAsync(const GURL& url,
|
|
|
|
const net::CookieOptions& options,
|
|
|
|
GetCookieListCallback callback) override;
|
|
|
|
void GetAllCookiesAsync(GetCookieListCallback callback) override;
|
2015-02-14 00:17:08 +01:00
|
|
|
void DeleteCookieAsync(const GURL& url,
|
|
|
|
const std::string& cookie_name,
|
2017-07-27 01:19:27 +02:00
|
|
|
base::OnceClosure callback) override;
|
2016-03-16 03:55:59 +01:00
|
|
|
void DeleteCanonicalCookieAsync(const net::CanonicalCookie& cookie,
|
2017-07-27 01:19:27 +02:00
|
|
|
DeleteCallback callback) override;
|
2018-05-20 15:51:42 +02:00
|
|
|
void DeleteAllCreatedInTimeRangeAsync(
|
|
|
|
const net::CookieDeletionInfo::TimeRange& creation_range,
|
|
|
|
DeleteCallback callback) override;
|
|
|
|
void DeleteAllMatchingInfoAsync(net::CookieDeletionInfo delete_info,
|
2018-05-16 11:28:49 +02:00
|
|
|
DeleteCallback callback) override;
|
2017-07-27 01:19:27 +02:00
|
|
|
void DeleteSessionCookiesAsync(DeleteCallback callback) override;
|
|
|
|
void FlushStore(base::OnceClosure callback) override;
|
2018-03-20 21:15:08 +01:00
|
|
|
net::CookieChangeDispatcher& GetChangeDispatcher() override;
|
2016-03-16 03:55:59 +01:00
|
|
|
bool IsEphemeral() override;
|
2015-02-14 00:17:08 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
net::CookieStore* GetCookieStore();
|
|
|
|
|
2018-10-08 17:57:14 +02:00
|
|
|
std::unique_ptr<CefCookieStoreSource> const source_;
|
2018-03-20 21:15:08 +01:00
|
|
|
std::unique_ptr<net::CookieChangeDispatcher> null_dispatcher_;
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefCookieStoreProxy);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_COOKIE_STORE_PROXY_H_
|