OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "android_webview/browser/aw_download_manager_delegate.h" | 10 #include "android_webview/browser/aw_download_manager_delegate.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/synchronization/lock.h" |
| 17 #include "base/synchronization/waitable_event.h" |
16 #include "components/visitedlink/browser/visitedlink_delegate.h" | 18 #include "components/visitedlink/browser/visitedlink_delegate.h" |
17 #include "content/public/browser/browser_context.h" | 19 #include "content/public/browser/browser_context.h" |
18 #include "content/public/browser/content_browser_client.h" | 20 #include "content/public/browser/content_browser_client.h" |
19 #include "content/public/browser/geolocation_permission_context.h" | 21 #include "content/public/browser/geolocation_permission_context.h" |
20 #include "net/url_request/url_request_job_factory.h" | 22 #include "net/url_request/url_request_job_factory.h" |
21 | 23 |
22 class GURL; | 24 class GURL; |
23 | 25 |
24 namespace content { | 26 namespace content { |
25 class ResourceContext; | 27 class ResourceContext; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 GetDownloadManagerDelegate() OVERRIDE; | 99 GetDownloadManagerDelegate() OVERRIDE; |
98 virtual content::GeolocationPermissionContext* | 100 virtual content::GeolocationPermissionContext* |
99 GetGeolocationPermissionContext() OVERRIDE; | 101 GetGeolocationPermissionContext() OVERRIDE; |
100 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 102 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
101 | 103 |
102 // visitedlink::VisitedLinkDelegate implementation. | 104 // visitedlink::VisitedLinkDelegate implementation. |
103 virtual void RebuildTable( | 105 virtual void RebuildTable( |
104 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; | 106 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
105 | 107 |
106 private: | 108 private: |
| 109 void CreateFormDatabaseServiceOnUiThread(); |
| 110 |
107 // The file path where data for this context is persisted. | 111 // The file path where data for this context is persisted. |
108 base::FilePath context_storage_path_; | 112 base::FilePath context_storage_path_; |
109 | 113 |
110 JniDependencyFactory* native_factory_; | 114 JniDependencyFactory* native_factory_; |
111 scoped_refptr<net::CookieStore> cookie_store_; | 115 scoped_refptr<net::CookieStore> cookie_store_; |
112 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; | 116 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; |
113 scoped_refptr<content::GeolocationPermissionContext> | 117 scoped_refptr<content::GeolocationPermissionContext> |
114 geolocation_permission_context_; | 118 geolocation_permission_context_; |
115 scoped_ptr<AwQuotaManagerBridge> quota_manager_bridge_; | 119 scoped_ptr<AwQuotaManagerBridge> quota_manager_bridge_; |
116 scoped_ptr<AwFormDatabaseService> form_database_service_; | 120 scoped_ptr<AwFormDatabaseService> form_database_service_; |
117 | 121 |
118 AwDownloadManagerDelegate download_manager_delegate_; | 122 AwDownloadManagerDelegate download_manager_delegate_; |
119 | 123 |
120 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; | 124 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; |
121 scoped_ptr<content::ResourceContext> resource_context_; | 125 scoped_ptr<content::ResourceContext> resource_context_; |
122 | 126 |
123 bool user_pref_service_ready_; | 127 bool user_pref_service_ready_; |
124 | 128 |
| 129 base::WaitableEvent form_database_service_creation_; |
| 130 base::Lock form_database_lock_; |
| 131 |
125 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); | 132 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
126 }; | 133 }; |
127 | 134 |
128 } // namespace android_webview | 135 } // namespace android_webview |
129 | 136 |
130 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 137 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
OLD | NEW |