REVIEW: Subscribe to cookie store for changes in place of CookieMonsterDelegate
This commit is contained in:
parent
60f69ad77b
commit
248d572077
11 changed files with 94 additions and 131 deletions
|
@ -8,8 +8,8 @@
|
|||
#include <string>
|
||||
|
||||
#include "atom/browser/api/trackable_object.h"
|
||||
#include "atom/browser/net/atom_cookie_delegate.h"
|
||||
#include "base/callback.h"
|
||||
#include "brightray/browser/net/cookie_details.h"
|
||||
#include "native_mate/handle.h"
|
||||
#include "net/cookies/canonical_cookie.h"
|
||||
|
||||
|
@ -27,8 +27,7 @@ class AtomBrowserContext;
|
|||
|
||||
namespace api {
|
||||
|
||||
class Cookies : public mate::TrackableObject<Cookies>,
|
||||
public AtomCookieDelegate::Observer {
|
||||
class Cookies : public mate::TrackableObject<Cookies> {
|
||||
public:
|
||||
enum Error {
|
||||
SUCCESS,
|
||||
|
@ -55,14 +54,14 @@ class Cookies : public mate::TrackableObject<Cookies>,
|
|||
void Set(const base::DictionaryValue& details, const SetCallback& callback);
|
||||
void FlushStore(const base::Closure& callback);
|
||||
|
||||
// AtomCookieDelegate::Observer:
|
||||
void OnCookieChanged(const net::CanonicalCookie& cookie,
|
||||
bool removed,
|
||||
net::CookieStore::ChangeCause cause) override;
|
||||
// brightray::URLRequestContextGetter subscription:
|
||||
void OnCookieChanged(const brightray::CookieDetails*);
|
||||
|
||||
private:
|
||||
net::URLRequestContextGetter* request_context_getter_;
|
||||
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
|
||||
std::unique_ptr<
|
||||
base::CallbackList<void(const brightray::CookieDetails*)>::Subscription>
|
||||
cookie_change_subscription_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Cookies);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue