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

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

Issue 2971733002: Change CookieStore::DeleteCallback to take uint32_t. (Closed)
Patch Set: Got rid of rest of <cstdint> stuff. Created 3 years, 5 months 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
« no previous file with comments | « no previous file | android_webview/browser/net/aw_cookie_store_wrapper.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/browser/cookie_manager.h" 5 #include "android_webview/browser/cookie_manager.h"
6 6
7 #include <stdint.h>
8
7 #include <memory> 9 #include <memory>
8 #include <utility> 10 #include <utility>
9 #include <vector> 11 #include <vector>
10 12
11 #include "android_webview/browser/aw_browser_context.h" 13 #include "android_webview/browser/aw_browser_context.h"
12 #include "android_webview/browser/aw_cookie_access_policy.h" 14 #include "android_webview/browser/aw_cookie_access_policy.h"
13 #include "android_webview/browser/net/init_native_callback.h" 15 #include "android_webview/browser/net/init_native_callback.h"
14 #include "base/android/jni_string.h" 16 #include "base/android/jni_string.h"
15 #include "base/android/path_utils.h" 17 #include "base/android/path_utils.h"
16 #include "base/bind.h" 18 #include "base/bind.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 201
200 void GetCookieValueAsyncHelper(const GURL& host, 202 void GetCookieValueAsyncHelper(const GURL& host,
201 std::string* result, 203 std::string* result,
202 base::Closure complete); 204 base::Closure complete);
203 void GetCookieValueCompleted(base::Closure complete, 205 void GetCookieValueCompleted(base::Closure complete,
204 std::string* result, 206 std::string* result,
205 const std::string& value); 207 const std::string& value);
206 208
207 void RemoveSessionCookiesHelper(BoolCallback callback); 209 void RemoveSessionCookiesHelper(BoolCallback callback);
208 void RemoveAllCookiesHelper(BoolCallback callback); 210 void RemoveAllCookiesHelper(BoolCallback callback);
209 void RemoveCookiesCompleted(BoolCallback callback, int num_deleted); 211 void RemoveCookiesCompleted(BoolCallback callback, uint32_t num_deleted);
210 212
211 void FlushCookieStoreAsyncHelper(base::Closure complete); 213 void FlushCookieStoreAsyncHelper(base::Closure complete);
212 214
213 void HasCookiesAsyncHelper(bool* result, base::Closure complete); 215 void HasCookiesAsyncHelper(bool* result, base::Closure complete);
214 void HasCookiesCompleted(base::Closure complete, 216 void HasCookiesCompleted(base::Closure complete,
215 bool* result, 217 bool* result,
216 const net::CookieList& cookies); 218 const net::CookieList& cookies);
217 219
218 // This protects the following two bools, as they're used on multiple threads. 220 // This protects the following two bools, as they're used on multiple threads.
219 base::Lock accept_file_scheme_cookies_lock_; 221 base::Lock accept_file_scheme_cookies_lock_;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 base::Unretained(this))); 443 base::Unretained(this)));
442 } 444 }
443 445
444 void CookieManager::RemoveSessionCookiesHelper(BoolCallback callback) { 446 void CookieManager::RemoveSessionCookiesHelper(BoolCallback callback) {
445 GetCookieStore()->DeleteSessionCookiesAsync( 447 GetCookieStore()->DeleteSessionCookiesAsync(
446 base::Bind(&CookieManager::RemoveCookiesCompleted, base::Unretained(this), 448 base::Bind(&CookieManager::RemoveCookiesCompleted, base::Unretained(this),
447 callback)); 449 callback));
448 } 450 }
449 451
450 void CookieManager::RemoveCookiesCompleted(BoolCallback callback, 452 void CookieManager::RemoveCookiesCompleted(BoolCallback callback,
451 int num_deleted) { 453 uint32_t num_deleted) {
452 callback.Run(num_deleted > 0); 454 callback.Run(num_deleted > 0u);
453 } 455 }
454 456
455 void CookieManager::RemoveAllCookies( 457 void CookieManager::RemoveAllCookies(
456 std::unique_ptr<BoolCookieCallbackHolder> callback_holder) { 458 std::unique_ptr<BoolCookieCallbackHolder> callback_holder) {
457 BoolCallback callback = 459 BoolCallback callback =
458 BoolCookieCallbackHolder::ConvertToCallback(std::move(callback_holder)); 460 BoolCookieCallbackHolder::ConvertToCallback(std::move(callback_holder));
459 ExecCookieTask(base::Bind(&CookieManager::RemoveAllCookiesHelper, 461 ExecCookieTask(base::Bind(&CookieManager::RemoveAllCookiesHelper,
460 base::Unretained(this), callback)); 462 base::Unretained(this), callback));
461 } 463 }
462 464
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 625
624 net::CookieStore* GetCookieStore() { 626 net::CookieStore* GetCookieStore() {
625 return CookieManager::GetInstance()->GetCookieStore(); 627 return CookieManager::GetInstance()->GetCookieStore();
626 } 628 }
627 629
628 bool RegisterCookieManager(JNIEnv* env) { 630 bool RegisterCookieManager(JNIEnv* env) {
629 return RegisterNativesImpl(env); 631 return RegisterNativesImpl(env);
630 } 632 }
631 633
632 } // namespace android_webview 634 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/aw_cookie_store_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698