Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10038)

Unified Diff: content/browser/net/cookie_store_map.h

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android webview init fix merged in. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/loader/resource_message_filter.h ('k') | content/browser/net/cookie_store_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/net/cookie_store_map.h
diff --git a/content/browser/net/cookie_store_map.h b/content/browser/net/cookie_store_map.h
new file mode 100644
index 0000000000000000000000000000000000000000..d792af2a426d0fedd73f198c9d52071bac15857f
--- /dev/null
+++ b/content/browser/net/cookie_store_map.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2013 The Chromium 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 CONTENT_BROWSER_NET_COOKIE_STORE_MAP_H_
+#define CONTENT_BROWSER_NET_COOKIE_STORE_MAP_H_
+
+#include <map>
+#include <string>
+
+#include "base/callback_forward.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/time/time.h"
+#include "content/common/content_export.h"
+
+class GURL;
+
+namespace net {
+class CookieStore;
+} // namespace net
+
+namespace content {
+
+// CookieStoreMap allows associating different CookieStore objects with
+// different schemes. It is mainly a convenience class.
+class CookieStoreMap {
+ public:
+ CookieStoreMap();
+ virtual ~CookieStoreMap();
+
+ // Returns the CookieStore associated with |scheme|.
+ CONTENT_EXPORT net::CookieStore* GetForScheme(
+ const std::string& scheme) const;
+
+ // Associates a |cookie_store| with the given |scheme|. Should only be called
+ // once for any given |scheme|. |cookie_store| must be non-NULL. The
+ // CookieStoreMap will retain the |cookie_store| object.
+ void SetForScheme(const std::string& scheme, net::CookieStore* cookie_store);
+
+ // Clears cookies matching the specified parameters from all CookieStores
+ // contained in this map. Calls |done| when all CookieStores have been
+ // cleared. |done| is guaranteed to be run on the calling thread.
+ void DeleteCookies(const GURL& origin,
+ const base::Time begin,
+ const base::Time end,
+ const base::Closure& done);
+
+ // Makes a clone of the map. Useful if the map needs to be copied to another
+ // thread.
+ CookieStoreMap* Clone() const;
+
+ private:
+ typedef std::map<std::string, scoped_refptr<net::CookieStore> > MapType;
+ MapType scheme_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(CookieStoreMap);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_NET_COOKIE_STORE_MAP_H_
« no previous file with comments | « content/browser/loader/resource_message_filter.h ('k') | content/browser/net/cookie_store_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698