| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h" | 5 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/trace_event/trace_event.h" |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 14 #include "base/location.h" | 15 #include "base/location.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/metrics/histogram_macros.h" | 20 #include "base/metrics/histogram_macros.h" |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 void SQLitePersistentCookieStore::Load(const LoadedCallback& loaded_callback) { | 1360 void SQLitePersistentCookieStore::Load(const LoadedCallback& loaded_callback) { |
| 1360 if (backend_) | 1361 if (backend_) |
| 1361 backend_->Load(loaded_callback); | 1362 backend_->Load(loaded_callback); |
| 1362 else | 1363 else |
| 1363 loaded_callback.Run(std::vector<CanonicalCookie*>()); | 1364 loaded_callback.Run(std::vector<CanonicalCookie*>()); |
| 1364 } | 1365 } |
| 1365 | 1366 |
| 1366 void SQLitePersistentCookieStore::LoadCookiesForKey( | 1367 void SQLitePersistentCookieStore::LoadCookiesForKey( |
| 1367 const std::string& key, | 1368 const std::string& key, |
| 1368 const LoadedCallback& loaded_callback) { | 1369 const LoadedCallback& loaded_callback) { |
| 1370 TRACE_EVENT0("toplevel", "SQLitePersistentCookieStore::LoadCookiesForKey"); |
| 1371 |
| 1369 if (backend_) | 1372 if (backend_) |
| 1370 backend_->LoadCookiesForKey(key, loaded_callback); | 1373 backend_->LoadCookiesForKey(key, loaded_callback); |
| 1371 else | 1374 else |
| 1372 loaded_callback.Run(std::vector<CanonicalCookie*>()); | 1375 loaded_callback.Run(std::vector<CanonicalCookie*>()); |
| 1373 } | 1376 } |
| 1374 | 1377 |
| 1375 void SQLitePersistentCookieStore::AddCookie(const CanonicalCookie& cc) { | 1378 void SQLitePersistentCookieStore::AddCookie(const CanonicalCookie& cc) { |
| 1376 if (backend_) | 1379 if (backend_) |
| 1377 backend_->AddCookie(cc); | 1380 backend_->AddCookie(cc); |
| 1378 } | 1381 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1395 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { | 1398 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { |
| 1396 if (backend_) | 1399 if (backend_) |
| 1397 backend_->Flush(callback); | 1400 backend_->Flush(callback); |
| 1398 } | 1401 } |
| 1399 | 1402 |
| 1400 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { | 1403 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { |
| 1401 Close(base::Closure()); | 1404 Close(base::Closure()); |
| 1402 } | 1405 } |
| 1403 | 1406 |
| 1404 } // namespace net | 1407 } // namespace net |
| OLD | NEW |