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

Side by Side Diff: chrome/browser/chrome_worker_message_filter.cc

Issue 7012007: Chrome side of having the WebKit FileSystem API use WebPermissionClient for checking if using fil... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_worker_message_filter.h" 5 #include "chrome/browser/chrome_worker_message_filter.h"
6 6
7 #include "chrome/browser/content_settings/host_content_settings_map.h" 7 #include "chrome/browser/content_settings/host_content_settings_map.h"
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
9 #include "content/browser/resource_context.h" 9 #include "content/browser/resource_context.h"
10 #include "content/browser/worker_host/worker_process_host.h" 10 #include "content/browser/worker_host/worker_process_host.h"
11 #include "content/common/worker_messages.h" 11 #include "content/common/worker_messages.h"
12 12
13 ChromeWorkerMessageFilter::ChromeWorkerMessageFilter(WorkerProcessHost* process) 13 ChromeWorkerMessageFilter::ChromeWorkerMessageFilter(WorkerProcessHost* process)
14 : process_(process) { 14 : process_(process) {
15 host_content_settings_map_ = 15 host_content_settings_map_ =
16 process->resource_context()->host_content_settings_map(); 16 process->resource_context()->host_content_settings_map();
17 } 17 }
18 18
19 ChromeWorkerMessageFilter::~ChromeWorkerMessageFilter() { 19 ChromeWorkerMessageFilter::~ChromeWorkerMessageFilter() {
20 } 20 }
21 21
22 bool ChromeWorkerMessageFilter::OnMessageReceived(const IPC::Message& message) { 22 bool ChromeWorkerMessageFilter::OnMessageReceived(const IPC::Message& message) {
23 bool handled = true; 23 bool handled = true;
24 IPC_BEGIN_MESSAGE_MAP(ChromeWorkerMessageFilter, message) 24 IPC_BEGIN_MESSAGE_MAP(ChromeWorkerMessageFilter, message)
25 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase) 25 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase)
26 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowFileSystem, OnAllowFileSystem)
26 IPC_MESSAGE_UNHANDLED(handled = false) 27 IPC_MESSAGE_UNHANDLED(handled = false)
27 IPC_END_MESSAGE_MAP() 28 IPC_END_MESSAGE_MAP()
28 29
29 return handled; 30 return handled;
30 } 31 }
31 32
32 bool ChromeWorkerMessageFilter::Send(IPC::Message* message) { 33 bool ChromeWorkerMessageFilter::Send(IPC::Message* message) {
33 return process_->Send(message); 34 return process_->Send(message);
34 } 35 }
35 36
(...skipping 22 matching lines...) Expand all
58 BrowserThread::PostTask( 59 BrowserThread::PostTask(
59 BrowserThread::UI, FROM_HERE, 60 BrowserThread::UI, FROM_HERE,
60 NewRunnableFunction( 61 NewRunnableFunction(
61 &TabSpecificContentSettings::WebDatabaseAccessed, 62 &TabSpecificContentSettings::WebDatabaseAccessed,
62 doc->render_process_id(), doc->render_view_id(), 63 doc->render_process_id(), doc->render_view_id(),
63 url, name, display_name, !*result)); 64 url, name, display_name, !*result));
64 } 65 }
65 break; 66 break;
66 } 67 }
67 } 68 }
69
70 void ChromeWorkerMessageFilter::OnAllowFileSystem(int worker_route_id,
71 const GURL& url,
72 bool* result) {
73 // TODO(kinuko): Need to notify the UI thread to indicate that
74 // there's a blocked content. See the above for inspiration.
75 ContentSetting content_setting =
76 host_content_settings_map_->GetContentSetting(
77 url, CONTENT_SETTINGS_TYPE_COOKIES, "");
78 *result = content_setting != CONTENT_SETTING_BLOCK;
79 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_worker_message_filter.h ('k') | chrome/browser/renderer_host/chrome_render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698