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

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

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixes. Created 8 years, 3 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 | Annotate | Revision Log
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_cookie_access_policy.h" 7 #include "android_webview/browser/aw_cookie_access_policy.h"
8 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
8 #include "android_webview/native/aw_browser_dependency_factory.h" 9 #include "android_webview/native/aw_browser_dependency_factory.h"
9 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
12 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
13 #include "content/public/browser/browser_context.h" 14 #include "content/public/browser/browser_context.h"
14 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
15 #include "net/cookies/cookie_monster.h" 16 #include "net/cookies/cookie_monster.h"
16 #include "net/cookies/cookie_options.h" 17 #include "net/cookies/cookie_options.h"
17 #include "net/cookies/cookie_store.h" 18 #include "net/cookies/cookie_store.h"
18 #include "net/url_request/url_request_context.h" 19 #include "net/url_request/url_request_context.h"
19 #include "net/url_request/url_request_context_getter.h" 20 #include "net/url_request/url_request_context_getter.h"
20 #include "jni/CookieManager_jni.h" 21 #include "jni/CookieManager_jni.h"
21 22
22 using base::android::ConvertJavaStringToUTF8; 23 using base::android::ConvertJavaStringToUTF8;
23 using base::android::ConvertJavaStringToUTF16; 24 using base::android::ConvertJavaStringToUTF16;
24 using content::BrowserThread; 25 using content::BrowserThread;
25 using net::CookieList; 26 using net::CookieList;
26 using net::CookieMonster; 27 using net::CookieMonster;
27 using net::URLRequestContextGetter; 28 using net::URLRequestContextGetter;
28 29
29 // This class is only available when building the chromium back-end for andriod
30 // webview: it is required where API backward compatibility demands that the UI
31 // thread must block waiting on other threads e.g. to obtain a synchronous
32 // return value. Long term, asynchronous overloads of all such methods will be
33 // added in the public API, and and no new uses of this will be allowed.
34 class ScopedAllowWaitForLegacyWebViewApi {
35 private:
36 base::ThreadRestrictions::ScopedAllowWait wait;
37 };
38
39 // CookieManager should be refactored to not require all tasks accessing the 30 // CookieManager should be refactored to not require all tasks accessing the
40 // CookieStore to be piped through the IO thread. It is currently required as 31 // CookieStore to be piped through the IO thread. It is currently required as
41 // the URLRequestContext provides the easiest mechanism for accessing the 32 // the URLRequestContext provides the easiest mechanism for accessing the
42 // CookieStore, but the CookieStore is threadsafe. In the future, we may 33 // CookieStore, but the CookieStore is threadsafe. In the future, we may
43 // instead want to inject an explicit CookieStore dependency into this object 34 // instead want to inject an explicit CookieStore dependency into this object
44 // during process initialization to avoid depending on the URLRequestContext. 35 // during process initialization to avoid depending on the URLRequestContext.
45 // 36 //
46 // In addition to the IO thread being the easiest access mechanism, it is also 37 // In addition to the IO thread being the easiest access mechanism, it is also
47 // used because the async cookie tasks need to be processed on a different 38 // used because the async cookie tasks need to be processed on a different
48 // thread than the caller from Java, which can be any thread. But, the calling 39 // thread than the caller from Java, which can be any thread. But, the calling
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 jboolean accept) { 285 jboolean accept) {
295 ExecCookieTask(base::Bind(&SetAcceptFileSchemeCookiesAsyncHelper, accept), 286 ExecCookieTask(base::Bind(&SetAcceptFileSchemeCookiesAsyncHelper, accept),
296 true); 287 true);
297 } 288 }
298 289
299 bool RegisterCookieManager(JNIEnv* env) { 290 bool RegisterCookieManager(JNIEnv* env) {
300 return RegisterNativesImpl(env); 291 return RegisterNativesImpl(env);
301 } 292 }
302 293
303 } // android_webview namespace 294 } // android_webview namespace
OLDNEW
« no previous file with comments | « android_webview/native/aw_web_contents_delegate.cc ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698