OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/net/sqlite_channel_id_store.h" | 5 #include "chrome/browser/net/sqlite_channel_id_store.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
20 #include "net/cert/x509_certificate.h" | 20 #include "net/cert/x509_certificate.h" |
21 #include "net/cookies/cookie_util.h" | 21 #include "net/cookies/cookie_util.h" |
22 #include "net/ssl/ssl_client_cert_type.h" | 22 #include "net/ssl/ssl_client_cert_type.h" |
23 #include "sql/error_delegate_util.h" | 23 #include "sql/error_delegate_util.h" |
24 #include "sql/meta_table.h" | 24 #include "sql/meta_table.h" |
25 #include "sql/statement.h" | 25 #include "sql/statement.h" |
26 #include "sql/transaction.h" | 26 #include "sql/transaction.h" |
27 #include "third_party/sqlite/sqlite3.h" | 27 #include "third_party/sqlite/sqlite3.h" |
28 #include "url/gurl.h" | 28 #include "url/gurl.h" |
29 #include "webkit/browser/quota/special_storage_policy.h" | 29 #include "storage/browser/quota/special_storage_policy.h" |
30 | 30 |
31 // This class is designed to be shared between any calling threads and the | 31 // This class is designed to be shared between any calling threads and the |
32 // background task runner. It batches operations and commits them on a timer. | 32 // background task runner. It batches operations and commits them on a timer. |
33 class SQLiteChannelIDStore::Backend | 33 class SQLiteChannelIDStore::Backend |
34 : public base::RefCountedThreadSafe<SQLiteChannelIDStore::Backend> { | 34 : public base::RefCountedThreadSafe<SQLiteChannelIDStore::Backend> { |
35 public: | 35 public: |
36 Backend( | 36 Backend( |
37 const base::FilePath& path, | 37 const base::FilePath& path, |
38 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 38 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
39 quota::SpecialStoragePolicy* special_storage_policy) | 39 quota::SpecialStoragePolicy* special_storage_policy) |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 632 |
633 void SQLiteChannelIDStore::SetForceKeepSessionState() { | 633 void SQLiteChannelIDStore::SetForceKeepSessionState() { |
634 backend_->SetForceKeepSessionState(); | 634 backend_->SetForceKeepSessionState(); |
635 } | 635 } |
636 | 636 |
637 SQLiteChannelIDStore::~SQLiteChannelIDStore() { | 637 SQLiteChannelIDStore::~SQLiteChannelIDStore() { |
638 backend_->Close(); | 638 backend_->Close(); |
639 // We release our reference to the Backend, though it will probably still have | 639 // We release our reference to the Backend, though it will probably still have |
640 // a reference if the background thread has not run Close() yet. | 640 // a reference if the background thread has not run Close() yet. |
641 } | 641 } |
OLD | NEW |