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

Unified Diff: ios/web_view/internal/web_view_browser_state.mm

Issue 2791403005: Remove CWV class and move setting User Agent to CWVWebViewConfiguration. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/internal/cwv_web_view_configuration.mm ('k') | ios/web_view/internal/web_view_web_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/web_view_browser_state.mm
diff --git a/ios/web_view/internal/web_view_browser_state.mm b/ios/web_view/internal/web_view_browser_state.mm
index 6a34819d4e913eeadac5e6246a68bd9e6412c824..c41432f649a98f1fb99b76df3609c1bc2da201ee 100644
--- a/ios/web_view/internal/web_view_browser_state.mm
+++ b/ios/web_view/internal/web_view_browser_state.mm
@@ -34,6 +34,11 @@ namespace ios_web_view {
WebViewBrowserState::WebViewBrowserState(bool off_the_record)
: web::BrowserState(), off_the_record_(off_the_record) {
+ // IO access is required to setup the browser state. In Chrome, this is
+ // already allowed during thread startup. However, startup time of
+ // ChromeWebView is not predetermined, so IO access is temporarily allowed.
+ bool wasIOAllowed = base::ThreadRestrictions::SetIOAllowed(true);
+
CHECK(PathService::Get(base::DIR_APP_DATA, &path_));
request_context_getter_ = new WebViewURLRequestContextGetter(
@@ -56,6 +61,8 @@ WebViewBrowserState::WebViewBrowserState(bool off_the_record)
PrefServiceFactory factory;
factory.set_user_prefs(user_pref_store);
prefs_ = factory.Create(pref_registry.get());
+
+ base::ThreadRestrictions::SetIOAllowed(wasIOAllowed);
}
WebViewBrowserState::~WebViewBrowserState() = default;
« no previous file with comments | « ios/web_view/internal/cwv_web_view_configuration.mm ('k') | ios/web_view/internal/web_view_web_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698