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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 338353007: Implementation of shared worker code path for WebView file system permission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_sharedworker
Patch Set: Rename + changes are made. Created 6 years, 6 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
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4b32ccd72b7fbaf54ff7ef30a70acde1d39f041f..3696451b99e8425ed7edd094c2d713d54ee5d425 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1902,10 +1902,11 @@ bool ChromeContentBrowserClient::AllowWorkerDatabase(
return allow;
}
-bool ChromeContentBrowserClient::AllowWorkerFileSystem(
+void ChromeContentBrowserClient::RequestWorkerFileSystemAccess(
const GURL& url,
content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_frames) {
+ const std::vector<std::pair<int, int> >& render_frames,
+ base::Callback<void(bool)> callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
CookieSettings* cookie_settings = io_data->GetCookieSettings();
@@ -1914,13 +1915,31 @@ bool ChromeContentBrowserClient::AllowWorkerFileSystem(
// Record access to file system for potential display in UI.
std::vector<std::pair<int, int> >::const_iterator i;
for (i = render_frames.begin(); i != render_frames.end(); ++i) {
+#if defined(ENABLE_EXTENSIONS)
+ bool is_web_view_guest =
+ ExtensionRendererState::GetInstance()->IsWebViewRenderer(i->first);
+ if (is_web_view_guest) {
+ BrowserThread::PostTask(BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&WebViewGuest::FileSystemAccessed,
+ i->first,
+ i->second,
+ url,
+ !allow,
+ callback));
+ continue;
+ }
+#endif
+ callback.Run(allow);
BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
+ BrowserThread::UI,
+ FROM_HERE,
base::Bind(&TabSpecificContentSettings::FileSystemAccessed,
- i->first, i->second, url, !allow));
+ i->first,
+ i->second,
+ url,
+ !allow));
}
-
- return allow;
}
bool ChromeContentBrowserClient::AllowWorkerIndexedDB(

Powered by Google App Engine
This is Rietveld 408576698