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

Unified Diff: chrome/browser/chrome_worker_message_filter.cc

Issue 6966036: Wrapping blocked filesystems into TabSpecificContentSettings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased onto trunk. Created 9 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/app/generated_resources.grd ('k') | chrome/browser/content_settings/tab_specific_content_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_worker_message_filter.cc
diff --git a/chrome/browser/chrome_worker_message_filter.cc b/chrome/browser/chrome_worker_message_filter.cc
index 453ac5d17de1df944fb55610ba47f02330dedadd..1b7fa2a74395f56381ecff391bd873b0f26cacd5 100644
--- a/chrome/browser/chrome_worker_message_filter.cc
+++ b/chrome/browser/chrome_worker_message_filter.cc
@@ -47,7 +47,8 @@ void ChromeWorkerMessageFilter::OnAllowDatabase(int worker_route_id,
*result = content_setting != CONTENT_SETTING_BLOCK;
- // Find the worker instance and forward the message to all attached documents.
+ // Record access to database for potential display in UI: Find the worker
+ // instance and forward the message to all attached documents.
WorkerProcessHost::Instances::const_iterator i;
for (i = process_->instances().begin(); i != process_->instances().end();
++i) {
@@ -71,9 +72,28 @@ void ChromeWorkerMessageFilter::OnAllowDatabase(int worker_route_id,
void ChromeWorkerMessageFilter::OnAllowFileSystem(int worker_route_id,
const GURL& url,
bool* result) {
- // TODO(kinuko): Need to notify the UI thread to indicate that
- // there's a blocked content. See the above for inspiration.
ContentSetting content_setting =
host_content_settings_map_->GetCookieContentSetting(url, url, true);
+
*result = content_setting != CONTENT_SETTING_BLOCK;
+
+ // Record access to file system for potential display in UI: Find the worker
+ // instance and forward the message to all attached documents.
+ WorkerProcessHost::Instances::const_iterator i;
+ for (i = process_->instances().begin(); i != process_->instances().end();
+ ++i) {
+ if (i->worker_route_id() != worker_route_id)
+ continue;
+ const WorkerDocumentSet::DocumentInfoSet& documents =
+ i->worker_document_set()->documents();
+ for (WorkerDocumentSet::DocumentInfoSet::const_iterator doc =
+ documents.begin(); doc != documents.end(); ++doc) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(
+ &TabSpecificContentSettings::FileSystemAccessed,
+ doc->render_process_id(), doc->render_view_id(), url, !*result));
+ }
+ break;
+ }
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/content_settings/tab_specific_content_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698