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

Side by Side Diff: content/browser/worker_host/worker_process_host.cc

Issue 10916132: AppCache and StoragePartition'ing (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/worker_host/worker_process_host.h" 5 #include "content/browser/worker_host/worker_process_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | 244 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS |
245 base::PLATFORM_FILE_WRITE); 245 base::PLATFORM_FILE_WRITE);
246 } 246 }
247 247
248 CreateMessageFilters(render_process_id); 248 CreateMessageFilters(render_process_id);
249 249
250 return true; 250 return true;
251 } 251 }
252 252
253 void WorkerProcessHost::CreateMessageFilters(int render_process_id) { 253 void WorkerProcessHost::CreateMessageFilters(int render_process_id) {
254 // TODO(michaeln): Put ChromeBlobStorageContext in StorageParition too.
255 ChromeBlobStorageContext* blob_storage_context =
256 content::GetChromeBlobStorageContextForResourceContext(
257 resource_context_);
258
259 // TODO(michaeln): This is not correct, shared workers will not be using the
260 // isolated/partitioned request context, they'll be using the cookies and
261 // cache associated with normal web browsing.
michaeln 2012/09/13 00:21:20 The wrong RequestContext here is a blocker i think
awong 2012/09/13 00:45:50 Ick. It is a blocker to 144549, but not m23 luckil
254 net::URLRequestContext* request_context = 262 net::URLRequestContext* request_context =
255 resource_context_->GetRequestContext(); 263 resource_context_->GetRequestContext();
256 264
257 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( 265 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
258 process_->GetData().id, content::PROCESS_TYPE_WORKER, resource_context_, 266 process_->GetData().id, content::PROCESS_TYPE_WORKER, resource_context_,
267 partition_.appcache_service(),
268 blob_storage_context,
259 new URLRequestContextSelector(request_context)); 269 new URLRequestContextSelector(request_context));
260 process_->GetHost()->AddFilter(resource_message_filter); 270 process_->GetHost()->AddFilter(resource_message_filter);
261 271
262 worker_message_filter_ = new WorkerMessageFilter( 272 worker_message_filter_ = new WorkerMessageFilter(
263 render_process_id, resource_context_, partition_, 273 render_process_id, resource_context_, partition_,
264 base::Bind(&WorkerServiceImpl::next_worker_route_id, 274 base::Bind(&WorkerServiceImpl::next_worker_route_id,
265 base::Unretained(WorkerServiceImpl::GetInstance()))); 275 base::Unretained(WorkerServiceImpl::GetInstance())));
266 process_->GetHost()->AddFilter(worker_message_filter_); 276 process_->GetHost()->AddFilter(worker_message_filter_);
267 process_->GetHost()->AddFilter(new AppCacheDispatcherHost( 277 process_->GetHost()->AddFilter(new AppCacheDispatcherHost(
268 static_cast<ChromeAppCacheService*>( 278 partition_.appcache_service(),
269 ResourceContext::GetAppCacheService(resource_context_)),
270 process_->GetData().id)); 279 process_->GetData().id));
271 process_->GetHost()->AddFilter(new FileAPIMessageFilter( 280 process_->GetHost()->AddFilter(new FileAPIMessageFilter(
272 process_->GetData().id, 281 process_->GetData().id,
273 request_context, 282 request_context,
274 partition_.filesystem_context(), 283 partition_.filesystem_context(),
275 content::GetChromeBlobStorageContextForResourceContext( 284 blob_storage_context));
276 resource_context_)));
277 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter( 285 process_->GetHost()->AddFilter(new FileUtilitiesMessageFilter(
278 process_->GetData().id)); 286 process_->GetData().id));
279 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter()); 287 process_->GetHost()->AddFilter(new MimeRegistryMessageFilter());
280 process_->GetHost()->AddFilter( 288 process_->GetHost()->AddFilter(
281 new DatabaseMessageFilter(partition_.database_tracker())); 289 new DatabaseMessageFilter(partition_.database_tracker()));
282 290
283 SocketStreamDispatcherHost* socket_stream_dispatcher_host = 291 SocketStreamDispatcherHost* socket_stream_dispatcher_host =
284 new SocketStreamDispatcherHost(render_process_id, 292 new SocketStreamDispatcherHost(render_process_id,
285 new URLRequestContextSelector(request_context), resource_context_); 293 new URLRequestContextSelector(request_context), resource_context_);
286 process_->GetHost()->AddFilter(socket_stream_dispatcher_host); 294 process_->GetHost()->AddFilter(socket_stream_dispatcher_host);
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } 709 }
702 } 710 }
703 return false; 711 return false;
704 } 712 }
705 713
706 WorkerProcessHost::WorkerInstance::FilterInfo 714 WorkerProcessHost::WorkerInstance::FilterInfo
707 WorkerProcessHost::WorkerInstance::GetFilter() const { 715 WorkerProcessHost::WorkerInstance::GetFilter() const {
708 DCHECK(NumFilters() == 1); 716 DCHECK(NumFilters() == 1);
709 return *filters_.begin(); 717 return *filters_.begin();
710 } 718 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698