OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef MOJO_SERVICES_NETWORK_MOJO_PERSISTENT_COOKIE_STORE_H_ | 5 #ifndef MOJO_SERVICES_NETWORK_MOJO_PERSISTENT_COOKIE_STORE_H_ |
6 #define MOJO_SERVICES_NETWORK_MOJO_PERSISTENT_COOKIE_STORE_H_ | 6 #define MOJO_SERVICES_NETWORK_MOJO_PERSISTENT_COOKIE_STORE_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
11 #include "mojo/services/network/network_service_delegate_observer.h" | 11 #include "mojo/services/network/network_service_delegate_observer.h" |
12 #include "net/cookies/cookie_monster.h" | 12 #include "net/cookies/cookie_monster.h" |
13 #include "net/extras/sqlite/cookie_crypto_delegate.h" | 13 #include "net/extras/sqlite/cookie_crypto_delegate.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 class SQLitePersistentCookieStore; | 16 class SQLitePersistentCookieStore; |
17 } // namespace net | 17 } // namespace net |
18 | 18 |
19 namespace mojo { | 19 namespace mojo { |
20 class NetworkServiceDelegate; | 20 class NetworkServiceDelegate; |
21 | 21 |
22 // A PersistentCookieStore that listens to NetworkContext's and tries to | 22 // A PersistentCookieStore that listens to NetworkContext's and tries to |
23 // gracefully shutdown when our ApplicationConnection is about to be closed. | 23 // gracefully shutdown when our Connection is about to be closed. |
24 class MojoPersistentCookieStore | 24 class MojoPersistentCookieStore |
25 : public net::CookieMonster::PersistentCookieStore, | 25 : public net::CookieMonster::PersistentCookieStore, |
26 public NetworkServiceDelegateObserver { | 26 public NetworkServiceDelegateObserver { |
27 public: | 27 public: |
28 MojoPersistentCookieStore( | 28 MojoPersistentCookieStore( |
29 NetworkServiceDelegate* network_service_delegate, | 29 NetworkServiceDelegate* network_service_delegate, |
30 const base::FilePath& path, | 30 const base::FilePath& path, |
31 const scoped_refptr<base::SequencedTaskRunner>& client_task_runner, | 31 const scoped_refptr<base::SequencedTaskRunner>& client_task_runner, |
32 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 32 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
33 bool restore_old_session_cookies, | 33 bool restore_old_session_cookies, |
(...skipping 22 matching lines...) Expand all Loading... |
56 // We own the |sql_cookie_store_| that we proxy for. We delete this during | 56 // We own the |sql_cookie_store_| that we proxy for. We delete this during |
57 // OnIOWorkerThreadShutdown(). | 57 // OnIOWorkerThreadShutdown(). |
58 scoped_refptr<net::SQLitePersistentCookieStore> sql_cookie_store_; | 58 scoped_refptr<net::SQLitePersistentCookieStore> sql_cookie_store_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(MojoPersistentCookieStore); | 60 DISALLOW_COPY_AND_ASSIGN(MojoPersistentCookieStore); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace mojo | 63 } // namespace mojo |
64 | 64 |
65 #endif // MOJO_SERVICES_NETWORK_MOJO_PERSISTENT_COOKIE_STORE_H_ | 65 #endif // MOJO_SERVICES_NETWORK_MOJO_PERSISTENT_COOKIE_STORE_H_ |
OLD | NEW |