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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 170733004: Avoid sync IPCs for FileSystem API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing early exit failure Created 6 years, 9 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/content_settings/tab_specific_content_settings.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index e54d95839627cde3a55f39cf2f47d1da1211353b..1ca618283dda212622c9b7f5b7abe5ab110a7c4e 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/content_settings_details.h"
#include "chrome/browser/content_settings/content_settings_utils.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/prerender/prerender_manager.h"
#include "chrome/browser/profiles/profile.h"
@@ -343,6 +344,26 @@ void TabSpecificContentSettings::OnContentAllowed(ContentSettingsType type) {
}
}
+void TabSpecificContentSettings::OnRequestFileSystemAccess(
+ const IPC::Message& message) {
+ int request_id;
+ GURL origin_url;
+ GURL top_origin_url;
+ if (!ChromeViewHostMsg_RequestFileSystemAccess::Read(
+ &message, &request_id, &origin_url, &top_origin_url))
+ return;
+
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents()->GetBrowserContext());
+ scoped_refptr<CookieSettings> cookie_settings(
+ CookieSettings::Factory::GetForProfile(profile));
+ bool allowed =
+ cookie_settings->IsSettingCookieAllowed(origin_url, top_origin_url);
+ OnFileSystemAccessed(origin_url, !allowed);
+ Send(new ChromeViewMsg_RequestFileSystemAccessResponse(
+ message.routing_id(), request_id, allowed));
+}
+
void TabSpecificContentSettings::OnCookiesRead(
const GURL& url,
const GURL& frame_url,
@@ -640,6 +661,8 @@ bool TabSpecificContentSettings::OnMessageReceived(
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(TabSpecificContentSettings, message)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ContentBlocked, OnContentBlocked)
+ IPC_MESSAGE_HANDLER_GENERIC(ChromeViewHostMsg_RequestFileSystemAccess,
jochen (gone - plz use gerrit) 2014/03/10 15:31:30 this should be handled in chrome_render_message_fi
+ OnRequestFileSystemAccess(message))
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;

Powered by Google App Engine
This is Rietveld 408576698