summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_content_browser_client.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 00:45:35 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 00:45:35 +0000
commit5c5a88eb6550c82143afec70d114a68f2bd8635b (patch)
tree954f56498cbd9cb4e1bb8032e860b50777332685 /chrome/browser/chrome_content_browser_client.cc
parent581ac1e0a6c31f93a4415cb840f24f6dbb7d969d (diff)
downloadchromium_src-5c5a88eb6550c82143afec70d114a68f2bd8635b.zip
chromium_src-5c5a88eb6550c82143afec70d114a68f2bd8635b.tar.gz
chromium_src-5c5a88eb6550c82143afec70d114a68f2bd8635b.tar.bz2
Remove includes of worker_messages.h from chrome code, since that's an internal detail of content.
BUG=98716 Review URL: http://codereview.chromium.org/8514004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109746 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_content_browser_client.cc')
-rw-r--r--chrome/browser/chrome_content_browser_client.cc76
1 files changed, 70 insertions, 6 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index dcab99b..eef9057 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/chrome_benchmarking_message_filter.h"
#include "chrome/browser/chrome_plugin_message_filter.h"
#include "chrome/browser/chrome_quota_permission_context.h"
-#include "chrome/browser/chrome_worker_message_filter.h"
#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/download/download_util.h"
@@ -331,11 +330,6 @@ void ChromeContentBrowserClient::PluginProcessHostCreated(
host->AddFilter(new ChromePluginMessageFilter(host));
}
-void ChromeContentBrowserClient::WorkerProcessHostCreated(
- WorkerProcessHost* host) {
- host->AddFilter(new ChromeWorkerMessageFilter(host));
-}
-
content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() {
return ChromeWebUIFactory::GetInstance();
}
@@ -722,6 +716,76 @@ bool ChromeContentBrowserClient::AllowSaveLocalState(
return !io_data->clear_local_state_on_exit()->GetValue();
}
+bool ChromeContentBrowserClient::AllowWorkerDatabase(
+ int worker_route_id,
+ const GURL& url,
+ const string16& name,
+ const string16& display_name,
+ unsigned long estimated_size,
+ WorkerProcessHost* worker_process_host) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(
+ worker_process_host->resource_context()->GetUserData(NULL));
+ CookieSettings* cookie_settings = io_data->GetCookieSettings();
+ bool allow = cookie_settings->IsSettingCookieAllowed(url, url);
+
+ // 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 = worker_process_host->instances().begin();
+ i != worker_process_host->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,
+ base::Bind(
+ &TabSpecificContentSettings::WebDatabaseAccessed,
+ doc->render_process_id(), doc->render_view_id(),
+ url, name, display_name, !allow));
+ }
+ break;
+ }
+
+ return allow;
+}
+
+bool ChromeContentBrowserClient::AllowWorkerFileSystem(
+ int worker_route_id,
+ const GURL& url,
+ WorkerProcessHost* worker_process_host) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(
+ worker_process_host->resource_context()->GetUserData(NULL));
+ CookieSettings* cookie_settings = io_data->GetCookieSettings();
+ bool allow = cookie_settings->IsSettingCookieAllowed(url, url);
+
+ // 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 = worker_process_host->instances().begin();
+ i != worker_process_host->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,
+ base::Bind(
+ &TabSpecificContentSettings::FileSystemAccessed,
+ doc->render_process_id(), doc->render_view_id(), url, !allow));
+ }
+ break;
+ }
+
+ return allow;
+}
+
net::URLRequestContext*
ChromeContentBrowserClient::OverrideRequestContextForURL(
const GURL& url, const content::ResourceContext& context) {