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

Unified Diff: ios/chrome/browser/net/cookie_util.mm

Issue 1701063002: CookieStore: Remove reference counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe
Patch Set: merge Created 4 years, 9 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 | « ios/chrome/browser/net/cookie_util.h ('k') | ios/chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/net/cookie_util.mm
diff --git a/ios/chrome/browser/net/cookie_util.mm b/ios/chrome/browser/net/cookie_util.mm
index d422adbaecc01ef24f63371de404ca22c568f968..6b2520fd82d78f4b6a631e8108507f37018a9cde 100644
--- a/ios/chrome/browser/net/cookie_util.mm
+++ b/ios/chrome/browser/net/cookie_util.mm
@@ -44,10 +44,11 @@ scoped_refptr<net::SQLitePersistentCookieStore> CreatePersistentCookieStore(
}
// Creates a CookieMonster configured by |config|.
-net::CookieMonster* CreateCookieMonster(const CookieStoreConfig& config) {
+scoped_ptr<net::CookieMonster> CreateCookieMonster(
+ const CookieStoreConfig& config) {
if (config.path.empty()) {
// Empty path means in-memory store.
- return new net::CookieMonster(nullptr, nullptr);
+ return make_scoped_ptr(new net::CookieMonster(nullptr, nullptr));
}
const bool restore_old_session_cookies =
@@ -55,8 +56,8 @@ net::CookieMonster* CreateCookieMonster(const CookieStoreConfig& config) {
scoped_refptr<net::SQLitePersistentCookieStore> persistent_store =
CreatePersistentCookieStore(config.path, restore_old_session_cookies,
config.crypto_delegate);
- net::CookieMonster* cookie_monster =
- new net::CookieMonster(persistent_store.get(), nullptr);
+ scoped_ptr<net::CookieMonster> cookie_monster(
+ new net::CookieMonster(persistent_store.get(), nullptr));
if (restore_old_session_cookies)
cookie_monster->SetPersistSessionCookies(true);
return cookie_monster;
@@ -77,7 +78,8 @@ CookieStoreConfig::CookieStoreConfig(const base::FilePath& path,
CookieStoreConfig::~CookieStoreConfig() {}
-net::CookieStore* CreateCookieStore(const CookieStoreConfig& config) {
+scoped_ptr<net::CookieStore> CreateCookieStore(
+ const CookieStoreConfig& config) {
if (config.cookie_store_type == CookieStoreConfig::COOKIE_MONSTER)
return CreateCookieMonster(config);
@@ -89,7 +91,7 @@ net::CookieStore* CreateCookieStore(const CookieStoreConfig& config) {
config.path, true /* restore_old_session_cookies */,
config.crypto_delegate);
}
- return new net::CookieStoreIOS(persistent_store.get());
+ return make_scoped_ptr(new net::CookieStoreIOS(persistent_store.get()));
}
bool ShouldClearSessionCookies() {
« no previous file with comments | « ios/chrome/browser/net/cookie_util.h ('k') | ios/chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698