| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "android_webview/native/cookie_manager.h" | 5 #include "android_webview/native/cookie_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
| 11 #include "android_webview/browser/aw_cookie_access_policy.h" | 11 #include "android_webview/browser/aw_cookie_access_policy.h" |
| 12 #include "android_webview/browser/net/init_native_callback.h" | 12 #include "android_webview/browser/net/init_native_callback.h" |
| 13 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | 13 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
| 14 #include "android_webview/native/aw_browser_dependency_factory.h" | 14 #include "android_webview/native/aw_browser_dependency_factory.h" |
| 15 #include "base/android/jni_string.h" | 15 #include "base/android/jni_string.h" |
| 16 #include "base/android/path_utils.h" | 16 #include "base/android/path_utils.h" |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/bind_helpers.h" | 18 #include "base/bind_helpers.h" |
| 19 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
| 20 #include "base/files/file_util.h" | 20 #include "base/files/file_util.h" |
| 21 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
| 22 #include "base/location.h" | 22 #include "base/location.h" |
| 23 #include "base/logging.h" | 23 #include "base/logging.h" |
| 24 #include "base/memory/ref_counted.h" |
| 25 #include "base/memory/scoped_ptr.h" |
| 24 #include "base/path_service.h" | 26 #include "base/path_service.h" |
| 25 #include "base/single_thread_task_runner.h" | 27 #include "base/single_thread_task_runner.h" |
| 26 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
| 27 #include "base/synchronization/waitable_event.h" | 29 #include "base/synchronization/waitable_event.h" |
| 28 #include "base/threading/sequenced_worker_pool.h" | 30 #include "base/threading/sequenced_worker_pool.h" |
| 29 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
| 30 #include "base/threading/thread_restrictions.h" | 32 #include "base/threading/thread_restrictions.h" |
| 31 #include "content/public/browser/browser_context.h" | 33 #include "content/public/browser/browser_context.h" |
| 32 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/cookie_store_factory.h" | 35 #include "content/public/browser/cookie_store_factory.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // to creating the CookieStore. | 219 // to creating the CookieStore. |
| 218 bool accept_file_scheme_cookies_; | 220 bool accept_file_scheme_cookies_; |
| 219 // True once the cookie store has been created. Just used to track when | 221 // True once the cookie store has been created. Just used to track when |
| 220 // |accept_file_scheme_cookies_| can no longer be modified. | 222 // |accept_file_scheme_cookies_| can no longer be modified. |
| 221 bool cookie_store_created_; | 223 bool cookie_store_created_; |
| 222 | 224 |
| 223 base::Thread cookie_store_client_thread_; | 225 base::Thread cookie_store_client_thread_; |
| 224 base::Thread cookie_store_backend_thread_; | 226 base::Thread cookie_store_backend_thread_; |
| 225 | 227 |
| 226 scoped_refptr<base::SingleThreadTaskRunner> cookie_store_task_runner_; | 228 scoped_refptr<base::SingleThreadTaskRunner> cookie_store_task_runner_; |
| 227 scoped_refptr<net::CookieStore> cookie_store_; | 229 scoped_ptr<net::CookieStore> cookie_store_; |
| 228 | 230 |
| 229 DISALLOW_COPY_AND_ASSIGN(CookieManager); | 231 DISALLOW_COPY_AND_ASSIGN(CookieManager); |
| 230 }; | 232 }; |
| 231 | 233 |
| 232 base::LazyInstance<CookieManager>::Leaky g_lazy_instance; | 234 base::LazyInstance<CookieManager>::Leaky g_lazy_instance; |
| 233 | 235 |
| 234 } // namespace | 236 } // namespace |
| 235 | 237 |
| 236 // static | 238 // static |
| 237 CookieManager* CookieManager::GetInstance() { | 239 CookieManager* CookieManager::GetInstance() { |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 615 |
| 614 net::CookieStore* GetCookieStore() { | 616 net::CookieStore* GetCookieStore() { |
| 615 return CookieManager::GetInstance()->GetCookieStore(); | 617 return CookieManager::GetInstance()->GetCookieStore(); |
| 616 } | 618 } |
| 617 | 619 |
| 618 bool RegisterCookieManager(JNIEnv* env) { | 620 bool RegisterCookieManager(JNIEnv* env) { |
| 619 return RegisterNativesImpl(env); | 621 return RegisterNativesImpl(env); |
| 620 } | 622 } |
| 621 | 623 |
| 622 } // android_webview namespace | 624 } // android_webview namespace |
| OLD | NEW |