2011-09-23 02:16:03 +02:00
|
|
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
2011-03-02 03:25:01 +01:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
// A sqlite implementation of a cookie monster persistent store.
|
|
|
|
|
|
|
|
// This class is based on src/chrome/browser/net/sqlite_persistent_cookie_store.h
|
|
|
|
// with the following modifications for use in the cef:
|
|
|
|
// - BrowserThread has been replaced with CefThread
|
|
|
|
// - Performance diagnostic code has been removed (UMA_HISTOGRAM_ENUMERATION)
|
|
|
|
|
|
|
|
#ifndef _BROWSER_PERSISTENT_COOKIE_STORE_H
|
|
|
|
#define _BROWSER_PERSISTENT_COOKIE_STORE_H
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2011-10-20 22:34:13 +02:00
|
|
|
#include "base/compiler_specific.h"
|
2011-04-05 18:17:33 +02:00
|
|
|
#include "base/memory/ref_counted.h"
|
2011-03-02 03:25:01 +01:00
|
|
|
#include "net/base/cookie_monster.h"
|
|
|
|
|
|
|
|
class FilePath;
|
2011-10-20 22:34:13 +02:00
|
|
|
class Task;
|
2011-03-02 03:25:01 +01:00
|
|
|
|
|
|
|
// Implements the PersistentCookieStore interface in terms of a SQLite database.
|
|
|
|
// For documentation about the actual member functions consult the documentation
|
|
|
|
// of the parent class |net::CookieMonster::PersistentCookieStore|.
|
|
|
|
class BrowserPersistentCookieStore
|
|
|
|
: public net::CookieMonster::PersistentCookieStore {
|
|
|
|
public:
|
2011-12-16 15:51:10 +01:00
|
|
|
BrowserPersistentCookieStore(const FilePath& path,
|
|
|
|
bool restore_old_session_cookies);
|
2011-03-02 03:25:01 +01:00
|
|
|
virtual ~BrowserPersistentCookieStore();
|
|
|
|
|
2011-10-20 22:34:13 +02:00
|
|
|
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
|
|
|
|
|
|
|
|
virtual void LoadCookiesForKey(const std::string& key,
|
|
|
|
const LoadedCallback& callback) OVERRIDE;
|
2011-09-23 02:16:03 +02:00
|
|
|
|
|
|
|
virtual void AddCookie(
|
|
|
|
const net::CookieMonster::CanonicalCookie& cc) OVERRIDE;
|
2011-03-02 03:25:01 +01:00
|
|
|
|
|
|
|
virtual void UpdateCookieAccessTime(
|
2011-09-23 02:16:03 +02:00
|
|
|
const net::CookieMonster::CanonicalCookie& cc) OVERRIDE;
|
|
|
|
|
|
|
|
virtual void DeleteCookie(
|
|
|
|
const net::CookieMonster::CanonicalCookie& cc) OVERRIDE;
|
2011-03-02 03:25:01 +01:00
|
|
|
|
2011-09-23 02:16:03 +02:00
|
|
|
virtual void SetClearLocalStateOnExit(bool clear_local_state) OVERRIDE;
|
2011-03-02 03:25:01 +01:00
|
|
|
|
2011-12-21 19:35:55 +01:00
|
|
|
virtual void Flush(const base::Closure& callback) OVERRIDE;
|
2011-03-02 03:25:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
class Backend;
|
|
|
|
|
|
|
|
scoped_refptr<Backend> backend_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(BrowserPersistentCookieStore);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _BROWSER_PERSISTENT_COOKIE_STORE_H
|