Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: android_webview/native/cookie_manager.cc

Issue 98603012: Revert of Encrypt all stored cookies on selected operating systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "android_webview/native/aw_browser_dependency_factory.h" 11 #include "android_webview/native/aw_browser_dependency_factory.h"
12 #include "base/android/jni_string.h" 12 #include "base/android/jni_string.h"
13 #include "base/android/path_utils.h" 13 #include "base/android/path_utils.h"
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/bind_helpers.h" 15 #include "base/bind_helpers.h"
16 #include "base/file_util.h" 16 #include "base/file_util.h"
17 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
18 #include "base/lazy_instance.h" 18 #include "base/lazy_instance.h"
19 #include "base/message_loop/message_loop.h" 19 #include "base/message_loop/message_loop.h"
20 #include "base/message_loop/message_loop_proxy.h" 20 #include "base/message_loop/message_loop_proxy.h"
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"
30 #include "content/public/browser/cookie_store_factory.h" 29 #include "content/public/browser/cookie_store_factory.h"
31 #include "content/public/common/url_constants.h" 30 #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"
36 35
37 using base::FilePath; 36 using base::FilePath;
38 using base::android::ConvertJavaStringToUTF8; 37 using base::android::ConvertJavaStringToUTF8;
39 using base::android::ConvertJavaStringToUTF16; 38 using base::android::ConvertJavaStringToUTF16;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 background_task_runner->PostTask( 183 background_task_runner->PostTask(
185 FROM_HERE, 184 FROM_HERE,
186 base::Bind(ImportLegacyCookieStore, cookie_store_path)); 185 base::Bind(ImportLegacyCookieStore, cookie_store_path));
187 186
188 net::CookieStore* cookie_store = content::CreatePersistentCookieStore( 187 net::CookieStore* cookie_store = content::CreatePersistentCookieStore(
189 cookie_store_path, 188 cookie_store_path,
190 true, 189 true,
191 NULL, 190 NULL,
192 NULL, 191 NULL,
193 client_task_runner, 192 client_task_runner,
194 background_task_runner, 193 background_task_runner);
195 scoped_ptr<content::CookieCryptoDelegate>());
196 cookie_monster_ = cookie_store->GetCookieMonster(); 194 cookie_monster_ = cookie_store->GetCookieMonster();
197 cookie_monster_->SetPersistSessionCookies(true); 195 cookie_monster_->SetPersistSessionCookies(true);
198 SetAcceptFileSchemeCookiesLocked(kDefaultFileSchemeAllowed); 196 SetAcceptFileSchemeCookiesLocked(kDefaultFileSchemeAllowed);
199 } 197 }
200 198
201 void CookieManager::EnsureCookieMonsterExistsLocked() { 199 void CookieManager::EnsureCookieMonsterExistsLocked() {
202 cookie_monster_lock_.AssertAcquired(); 200 cookie_monster_lock_.AssertAcquired();
203 if (cookie_monster_.get()) { 201 if (cookie_monster_.get()) {
204 return; 202 return;
205 } 203 }
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 AwBrowserContext* browser_context) { 495 AwBrowserContext* browser_context) {
498 return CookieManager::GetInstance()->CreateBrowserThreadCookieStore( 496 return CookieManager::GetInstance()->CreateBrowserThreadCookieStore(
499 browser_context); 497 browser_context);
500 } 498 }
501 499
502 bool RegisterCookieManager(JNIEnv* env) { 500 bool RegisterCookieManager(JNIEnv* env) {
503 return RegisterNativesImpl(env); 501 return RegisterNativesImpl(env);
504 } 502 }
505 503
506 } // android_webview namespace 504 } // android_webview namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698