summaryrefslogtreecommitdiffstats
path: root/content/browser/worker_host
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 02:58:07 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 02:58:07 +0000
commita1e6ad0532c7537ee72bcdce23fe8a8932114b5e (patch)
tree31800c70679ae35080f3dde03c0a3c9af929caa9 /content/browser/worker_host
parent99f8e0d06b19334c93fd15b9e74feedc8971fa37 (diff)
downloadchromium_src-a1e6ad0532c7537ee72bcdce23fe8a8932114b5e.zip
chromium_src-a1e6ad0532c7537ee72bcdce23fe8a8932114b5e.tar.gz
chromium_src-a1e6ad0532c7537ee72bcdce23fe8a8932114b5e.tar.bz2
Remove ChromeURLRequestContext from content/.
Takes the last remaining uses and kills them, or moves them into ResourceContext. Some of the additions to ResourceContext don't belong there either and will need to be removed. BUG=77086,78596 TEST=none Review URL: http://codereview.chromium.org/6880263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/worker_host')
-rw-r--r--content/browser/worker_host/worker_message_filter.cc1
-rw-r--r--content/browser/worker_host/worker_process_host.cc27
-rw-r--r--content/browser/worker_host/worker_process_host.h3
-rw-r--r--content/browser/worker_host/worker_service.h1
4 files changed, 15 insertions, 17 deletions
diff --git a/content/browser/worker_host/worker_message_filter.cc b/content/browser/worker_host/worker_message_filter.cc
index dc18ee5..c9a0745 100644
--- a/content/browser/worker_host/worker_message_filter.cc
+++ b/content/browser/worker_host/worker_message_filter.cc
@@ -4,7 +4,6 @@
#include "content/browser/worker_host/worker_message_filter.h"
-#include "chrome/browser/net/chrome_url_request_context.h"
#include "content/browser/resource_context.h"
#include "content/browser/worker_host/message_port_service.h"
#include "content/browser/worker_host/worker_service.h"
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index a67cbf1..47783a1 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -12,6 +12,8 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/extensions/extension_info_map.h"
#include "content/browser/appcache/appcache_dispatcher_host.h"
#include "content/browser/browser_thread.h"
#include "content/browser/child_process_security_policy.h"
@@ -37,6 +39,7 @@
#include "net/base/mime_util.h"
#include "ipc/ipc_switches.h"
#include "net/base/registry_controlled_domain.h"
+#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_path_manager.h"
#include "webkit/fileapi/sandbox_mount_point_provider.h"
#include "webkit/glue/resource_type.h"
@@ -184,7 +187,7 @@ bool WorkerProcessHost::Init(int render_process_id) {
// requests them.
ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
id(),
- GetChromeURLRequestContext()->file_system_context()->
+ resource_context_->file_system_context()->
path_manager()->sandbox_provider()->base_path(),
base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_CREATE |
@@ -206,11 +209,12 @@ bool WorkerProcessHost::Init(int render_process_id) {
void WorkerProcessHost::CreateMessageFilters(int render_process_id) {
DCHECK(resource_context_);
- ChromeURLRequestContext* chrome_url_context = GetChromeURLRequestContext();
+ net::URLRequestContext* request_context =
+ resource_context_->request_context();
ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
id(), WORKER_PROCESS, resource_context_,
- new URLRequestContextSelector(chrome_url_context),
+ new URLRequestContextSelector(request_context),
resource_dispatcher_host_);
AddFilter(resource_message_filter);
@@ -223,18 +227,20 @@ void WorkerProcessHost::CreateMessageFilters(int render_process_id) {
AddFilter(worker_message_filter_);
AddFilter(new AppCacheDispatcherHost(resource_context_, id()));
AddFilter(new FileSystemDispatcherHost(
- chrome_url_context, resource_context_->file_system_context()));
+ request_context,
+ resource_context_->host_content_settings_map(),
+ resource_context_->file_system_context()));
AddFilter(new FileUtilitiesMessageFilter(id()));
AddFilter(
new BlobMessageFilter(id(), resource_context_->blob_storage_context()));
AddFilter(new MimeRegistryMessageFilter());
AddFilter(new DatabaseMessageFilter(
resource_context_->database_tracker(),
- chrome_url_context->host_content_settings_map()));
+ resource_context_->host_content_settings_map()));
SocketStreamDispatcherHost* socket_stream_dispatcher_host =
new SocketStreamDispatcherHost(
- new URLRequestContextSelector(chrome_url_context));
+ new URLRequestContextSelector(request_context));
AddFilter(socket_stream_dispatcher_host);
}
@@ -339,7 +345,7 @@ void WorkerProcessHost::OnAllowDatabase(int worker_route_id,
const string16& display_name,
unsigned long estimated_size,
bool* result) {
- ContentSetting content_setting = GetChromeURLRequestContext()->
+ ContentSetting content_setting = resource_context_->
host_content_settings_map()->GetContentSetting(
url, CONTENT_SETTINGS_TYPE_COOKIES, "");
@@ -458,7 +464,7 @@ void WorkerProcessHost::UpdateTitle() {
// Check if it's an extension-created worker, in which case we want to use
// the name of the extension.
- std::string extension_name = GetChromeURLRequestContext()->
+ std::string extension_name = resource_context_->
extension_info_map()->GetNameForExtension(title);
if (!extension_name.empty()) {
titles.insert(extension_name);
@@ -482,11 +488,6 @@ void WorkerProcessHost::UpdateTitle() {
set_name(ASCIIToWide(display_title));
}
-ChromeURLRequestContext* WorkerProcessHost::GetChromeURLRequestContext() {
- return static_cast<ChromeURLRequestContext*>(
- resource_context_->request_context());
-}
-
void WorkerProcessHost::DocumentDetached(WorkerMessageFilter* filter,
unsigned long long document_id) {
// Walk all instances and remove the document from their document set.
diff --git a/content/browser/worker_host/worker_process_host.h b/content/browser/worker_host/worker_process_host.h
index 0f49ee6..00005aa 100644
--- a/content/browser/worker_host/worker_process_host.h
+++ b/content/browser/worker_host/worker_process_host.h
@@ -10,7 +10,6 @@
#include "base/basictypes.h"
#include "base/file_path.h"
-#include "chrome/browser/net/chrome_url_request_context.h"
#include "content/browser/browser_child_process_host.h"
#include "content/browser/worker_host/worker_document_set.h"
#include "googleurl/src/gurl.h"
@@ -176,8 +175,6 @@ class WorkerProcessHost : public BrowserChildProcessHost {
// Updates the title shown in the task manager.
void UpdateTitle();
- ChromeURLRequestContext* GetChromeURLRequestContext();
-
Instances instances_;
const content::ResourceContext* const resource_context_;
diff --git a/content/browser/worker_host/worker_service.h b/content/browser/worker_host/worker_service.h
index b6c3abc..a84f410 100644
--- a/content/browser/worker_host/worker_service.h
+++ b/content/browser/worker_host/worker_service.h
@@ -10,6 +10,7 @@
#include "base/memory/singleton.h"
#include "base/threading/non_thread_safe.h"
#include "content/browser/worker_host/worker_process_host.h"
+#include "content/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
namespace content {