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

Unified Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 273513005: Avoid sync IPCs for FileSystem API [chromium] (2/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 7 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 | « chrome/browser/renderer_host/chrome_render_message_filter.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index d7fdaf675060ce1bdd33ce0a98ba702430559652..f50fb11bdd247aeb51c0a6fae8fe715db38a2f3b 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -123,7 +123,10 @@ bool ChromeRenderMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnAddEventToExtensionActivityLog);
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDatabase, OnAllowDatabase)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDOMStorage, OnAllowDOMStorage)
- IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowFileSystem, OnAllowFileSystem)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestFileSystemAccessSync,
+ OnRequestFileSystemAccessSync)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestFileSystemAccessAsync,
+ OnRequestFileSystemAccessAsync)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardRead,
OnCanTriggerClipboardRead)
@@ -432,10 +435,11 @@ void ChromeRenderMessageFilter::OnAllowDOMStorage(int render_frame_id,
!*allowed));
}
-void ChromeRenderMessageFilter::OnAllowFileSystem(int render_frame_id,
- const GURL& origin_url,
- const GURL& top_origin_url,
- bool* allowed) {
+void ChromeRenderMessageFilter::OnRequestFileSystemAccessSync(
+ int render_frame_id,
+ const GURL& origin_url,
+ const GURL& top_origin_url,
+ bool* allowed) {
*allowed =
cookie_settings_->IsSettingCookieAllowed(origin_url, top_origin_url);
// Record access to file system for potential display in UI.
@@ -445,6 +449,31 @@ void ChromeRenderMessageFilter::OnAllowFileSystem(int render_frame_id,
render_process_id_, render_frame_id, origin_url, !*allowed));
}
+void ChromeRenderMessageFilter::OnRequestFileSystemAccessAsync(
+ int render_frame_id,
+ int request_id,
+ const GURL& origin_url,
+ const GURL& top_origin_url) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ bool allowed =
+ cookie_settings_->IsSettingCookieAllowed(origin_url, top_origin_url);
+ // Record access to file system for potential display in UI.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(
+ &TabSpecificContentSettings::FileSystemAccessed,
+ render_process_id_,
+ render_frame_id,
+ origin_url,
+ !allowed));
+
+ Send(new ChromeViewMsg_RequestFileSystemAccessAsyncResponse(
+ render_frame_id,
+ request_id,
+ allowed));
+}
+
void ChromeRenderMessageFilter::OnAllowIndexedDB(int render_frame_id,
const GURL& origin_url,
const GURL& top_origin_url,
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_message_filter.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698