| 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 #ifndef CHROME_BROWSER_ANDROID_COOKIES_COOKIES_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COOKIES_COOKIES_FETCHER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_COOKIES_COOKIES_FETCHER_H_ | 6 #define CHROME_BROWSER_ANDROID_COOKIES_COOKIES_FETCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| 9 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/basictypes.h" | 12 #include "base/macros.h" |
| 11 #include "net/cookies/canonical_cookie.h" | 13 #include "net/cookies/canonical_cookie.h" |
| 12 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
| 13 | 15 |
| 14 class Profile; | 16 class Profile; |
| 15 | 17 |
| 16 // This class can be used to retrieve an array of cookies from the cookie jar | 18 // This class can be used to retrieve an array of cookies from the cookie jar |
| 17 // as well as insert an array of cookies into it. This class is the underlying | 19 // as well as insert an array of cookies into it. This class is the underlying |
| 18 // glue that interacts with CookiesFetch.java and its lifetime is governed by | 20 // glue that interacts with CookiesFetch.java and its lifetime is governed by |
| 19 // the Java counter part. | 21 // the Java counter part. |
| 20 class CookiesFetcher { | 22 class CookiesFetcher { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 const base::android::JavaParamRef<jobject>& obj); | 38 const base::android::JavaParamRef<jobject>& obj); |
| 37 | 39 |
| 38 // Saves a cookie to the cookie jar. | 40 // Saves a cookie to the cookie jar. |
| 39 void RestoreCookies(JNIEnv* env, | 41 void RestoreCookies(JNIEnv* env, |
| 40 const base::android::JavaParamRef<jobject>& obj, | 42 const base::android::JavaParamRef<jobject>& obj, |
| 41 const base::android::JavaParamRef<jstring>& url, | 43 const base::android::JavaParamRef<jstring>& url, |
| 42 const base::android::JavaParamRef<jstring>& name, | 44 const base::android::JavaParamRef<jstring>& name, |
| 43 const base::android::JavaParamRef<jstring>& value, | 45 const base::android::JavaParamRef<jstring>& value, |
| 44 const base::android::JavaParamRef<jstring>& domain, | 46 const base::android::JavaParamRef<jstring>& domain, |
| 45 const base::android::JavaParamRef<jstring>& path, | 47 const base::android::JavaParamRef<jstring>& path, |
| 46 int64 creation, | 48 int64_t creation, |
| 47 int64 expiration, | 49 int64_t expiration, |
| 48 int64 last_access, | 50 int64_t last_access, |
| 49 bool secure, | 51 bool secure, |
| 50 bool httponly, | 52 bool httponly, |
| 51 bool firstpartyonly, | 53 bool firstpartyonly, |
| 52 int priority); | 54 int priority); |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 void PersistCookiesInternal(net::URLRequestContextGetter* getter); | 57 void PersistCookiesInternal(net::URLRequestContextGetter* getter); |
| 56 void RestoreToCookieJarInternal(net::URLRequestContextGetter* getter, | 58 void RestoreToCookieJarInternal(net::URLRequestContextGetter* getter, |
| 57 const net::CanonicalCookie& cookie); | 59 const net::CanonicalCookie& cookie); |
| 58 | 60 |
| 59 base::android::ScopedJavaGlobalRef<jobject> jobject_; | 61 base::android::ScopedJavaGlobalRef<jobject> jobject_; |
| 60 | 62 |
| 61 DISALLOW_COPY_AND_ASSIGN(CookiesFetcher); | 63 DISALLOW_COPY_AND_ASSIGN(CookiesFetcher); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 // Registers the CookiesFetcher native method. | 66 // Registers the CookiesFetcher native method. |
| 65 bool RegisterCookiesFetcher(JNIEnv* env); | 67 bool RegisterCookiesFetcher(JNIEnv* env); |
| 66 | 68 |
| 67 #endif // CHROME_BROWSER_ANDROID_COOKIES_COOKIES_FETCHER_H_ | 69 #endif // CHROME_BROWSER_ANDROID_COOKIES_COOKIES_FETCHER_H_ |
| OLD | NEW |