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

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: Revert nameing changes. 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 e7847f655f797c8a42718e5c9eabc60b33550cc7..af73053e15fe8374543824be3bb93e18a33bdb5e 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1817,10 +1817,11 @@ bool ChromeContentBrowserClient::AllowWorkerDatabase(
return allow;
}
-bool ChromeContentBrowserClient::AllowWorkerFileSystem(
+void ChromeContentBrowserClient::AllowWorkerFileSystem(
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();
@@ -1829,13 +1830,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