| 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 #include "content/browser/net/quota_policy_cookie_store.h" | 5 #include "content/browser/net/quota_policy_cookie_store.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/profiler/scoped_tracker.h" | 15 #include "base/profiler/scoped_tracker.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/task_scheduler/post_task.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/cookie_store_factory.h" | 18 #include "content/public/browser/cookie_store_factory.h" |
| 19 #include "net/cookies/canonical_cookie.h" | 19 #include "net/cookies/canonical_cookie.h" |
| 20 #include "net/cookies/cookie_constants.h" | 20 #include "net/cookies/cookie_constants.h" |
| 21 #include "net/cookies/cookie_util.h" | 21 #include "net/cookies/cookie_util.h" |
| 22 #include "net/extras/sqlite/cookie_crypto_delegate.h" | 22 #include "net/extras/sqlite/cookie_crypto_delegate.h" |
| 23 #include "storage/browser/quota/special_storage_policy.h" | 23 #include "storage/browser/quota/special_storage_policy.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 config.client_task_runner; | 147 config.client_task_runner; |
| 148 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | 148 scoped_refptr<base::SequencedTaskRunner> background_task_runner = |
| 149 config.background_task_runner; | 149 config.background_task_runner; |
| 150 | 150 |
| 151 if (!client_task_runner.get()) { | 151 if (!client_task_runner.get()) { |
| 152 client_task_runner = | 152 client_task_runner = |
| 153 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 153 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (!background_task_runner.get()) { | 156 if (!background_task_runner.get()) { |
| 157 background_task_runner = | 157 background_task_runner = base::CreateSequencedTaskRunnerWithTraits( |
| 158 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 158 base::TaskTraits().MayBlock().WithPriority( |
| 159 base::SequencedWorkerPool::GetSequenceToken()); | 159 base::TaskPriority::BACKGROUND)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store( | 162 scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store( |
| 163 new net::SQLitePersistentCookieStore( | 163 new net::SQLitePersistentCookieStore( |
| 164 config.path, | 164 config.path, |
| 165 client_task_runner, | 165 client_task_runner, |
| 166 background_task_runner, | 166 background_task_runner, |
| 167 (config.session_cookie_mode == | 167 (config.session_cookie_mode == |
| 168 CookieStoreConfig::RESTORED_SESSION_COOKIES), | 168 CookieStoreConfig::RESTORED_SESSION_COOKIES), |
| 169 config.crypto_delegate)); | 169 config.crypto_delegate)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 if (!config.cookieable_schemes.empty()) | 186 if (!config.cookieable_schemes.empty()) |
| 187 cookie_monster->SetCookieableSchemes(config.cookieable_schemes); | 187 cookie_monster->SetCookieableSchemes(config.cookieable_schemes); |
| 188 | 188 |
| 189 return std::move(cookie_monster); | 189 return std::move(cookie_monster); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace content | 192 } // namespace content |
| OLD | NEW |