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 "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_cookie_access_policy.h" | 8 #include "android_webview/browser/aw_cookie_access_policy.h" |
9 #include "android_webview/browser/net/init_native_callback.h" | 9 #include "android_webview/browser/net/init_native_callback.h" |
10 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | 10 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/path_service.h" | 21 #include "base/path_service.h" |
22 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
24 #include "base/threading/sequenced_worker_pool.h" | 24 #include "base/threading/sequenced_worker_pool.h" |
25 #include "base/threading/thread.h" | 25 #include "base/threading/thread.h" |
26 #include "base/threading/thread_restrictions.h" | 26 #include "base/threading/thread_restrictions.h" |
27 #include "content/public/browser/browser_context.h" | 27 #include "content/public/browser/browser_context.h" |
28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/cookie_crypto_delegate.h" | 29 #include "content/public/browser/cookie_crypto_delegate.h" |
30 #include "content/public/browser/cookie_store_factory.h" | 30 #include "content/public/browser/cookie_store_factory.h" |
31 #include "content/public/common/url_constants.h" | |
32 #include "jni/AwCookieManager_jni.h" | 31 #include "jni/AwCookieManager_jni.h" |
33 #include "net/cookies/cookie_monster.h" | 32 #include "net/cookies/cookie_monster.h" |
34 #include "net/cookies/cookie_options.h" | 33 #include "net/cookies/cookie_options.h" |
35 #include "net/url_request/url_request_context.h" | 34 #include "net/url_request/url_request_context.h" |
| 35 #include "url/url_constants.h" |
36 | 36 |
37 using base::FilePath; | 37 using base::FilePath; |
38 using base::WaitableEvent; | 38 using base::WaitableEvent; |
39 using base::android::ConvertJavaStringToUTF8; | 39 using base::android::ConvertJavaStringToUTF8; |
40 using base::android::ConvertJavaStringToUTF16; | 40 using base::android::ConvertJavaStringToUTF16; |
41 using base::android::ScopedJavaGlobalRef; | 41 using base::android::ScopedJavaGlobalRef; |
42 using content::BrowserThread; | 42 using content::BrowserThread; |
43 using net::CookieList; | 43 using net::CookieList; |
44 using net::CookieMonster; | 44 using net::CookieMonster; |
45 | 45 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 complete.Run(); | 501 complete.Run(); |
502 } | 502 } |
503 | 503 |
504 bool CookieManager::AllowFileSchemeCookies() { | 504 bool CookieManager::AllowFileSchemeCookies() { |
505 base::AutoLock lock(cookie_monster_lock_); | 505 base::AutoLock lock(cookie_monster_lock_); |
506 EnsureCookieMonsterExistsLocked(); | 506 EnsureCookieMonsterExistsLocked(); |
507 return AllowFileSchemeCookiesLocked(); | 507 return AllowFileSchemeCookiesLocked(); |
508 } | 508 } |
509 | 509 |
510 bool CookieManager::AllowFileSchemeCookiesLocked() { | 510 bool CookieManager::AllowFileSchemeCookiesLocked() { |
511 return cookie_monster_->IsCookieableScheme(content::kFileScheme); | 511 return cookie_monster_->IsCookieableScheme(url::kFileScheme); |
512 } | 512 } |
513 | 513 |
514 void CookieManager::SetAcceptFileSchemeCookies(bool accept) { | 514 void CookieManager::SetAcceptFileSchemeCookies(bool accept) { |
515 base::AutoLock lock(cookie_monster_lock_); | 515 base::AutoLock lock(cookie_monster_lock_); |
516 EnsureCookieMonsterExistsLocked(); | 516 EnsureCookieMonsterExistsLocked(); |
517 SetAcceptFileSchemeCookiesLocked(accept); | 517 SetAcceptFileSchemeCookiesLocked(accept); |
518 } | 518 } |
519 | 519 |
520 void CookieManager::SetAcceptFileSchemeCookiesLocked(bool accept) { | 520 void CookieManager::SetAcceptFileSchemeCookiesLocked(bool accept) { |
521 // The docs on CookieManager base class state the API must not be called after | 521 // The docs on CookieManager base class state the API must not be called after |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 scoped_refptr<net::CookieStore> CreateCookieStore( | 623 scoped_refptr<net::CookieStore> CreateCookieStore( |
624 AwBrowserContext* browser_context) { | 624 AwBrowserContext* browser_context) { |
625 return CookieManager::GetInstance()->GetCookieStore(); | 625 return CookieManager::GetInstance()->GetCookieStore(); |
626 } | 626 } |
627 | 627 |
628 bool RegisterCookieManager(JNIEnv* env) { | 628 bool RegisterCookieManager(JNIEnv* env) { |
629 return RegisterNativesImpl(env); | 629 return RegisterNativesImpl(env); |
630 } | 630 } |
631 | 631 |
632 } // android_webview namespace | 632 } // android_webview namespace |
OLD | NEW |