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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 10837230: Move StoragePartition into content/public and remove BrowserContext::GetDOMStorageContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DISALLOW_COPY_AND_ASSIGN, and change RPH::CreateMessageFilters() to not suddenly isolate all… Created 8 years, 4 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" 74 #include "content/browser/renderer_host/pepper/pepper_message_filter.h"
75 #include "content/browser/renderer_host/quota_dispatcher_host.h" 75 #include "content/browser/renderer_host/quota_dispatcher_host.h"
76 #include "content/browser/renderer_host/render_message_filter.h" 76 #include "content/browser/renderer_host/render_message_filter.h"
77 #include "content/browser/renderer_host/render_view_host_delegate.h" 77 #include "content/browser/renderer_host/render_view_host_delegate.h"
78 #include "content/browser/renderer_host/render_view_host_impl.h" 78 #include "content/browser/renderer_host/render_view_host_impl.h"
79 #include "content/browser/renderer_host/render_widget_helper.h" 79 #include "content/browser/renderer_host/render_widget_helper.h"
80 #include "content/browser/renderer_host/resource_message_filter.h" 80 #include "content/browser/renderer_host/resource_message_filter.h"
81 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" 81 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
82 #include "content/browser/renderer_host/text_input_client_message_filter.h" 82 #include "content/browser/renderer_host/text_input_client_message_filter.h"
83 #include "content/browser/resolve_proxy_msg_helper.h" 83 #include "content/browser/resolve_proxy_msg_helper.h"
84 #include "content/browser/storage_partition_impl.h"
84 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" 85 #include "content/browser/speech/input_tag_speech_dispatcher_host.h"
85 #include "content/browser/speech/speech_recognition_dispatcher_host.h" 86 #include "content/browser/speech/speech_recognition_dispatcher_host.h"
86 #include "content/browser/trace_message_filter.h" 87 #include "content/browser/trace_message_filter.h"
87 #include "content/browser/worker_host/worker_message_filter.h" 88 #include "content/browser/worker_host/worker_message_filter.h"
88 #include "content/common/child_process_host_impl.h" 89 #include "content/common/child_process_host_impl.h"
89 #include "content/common/child_process_messages.h" 90 #include "content/common/child_process_messages.h"
90 #include "content/common/gpu/gpu_messages.h" 91 #include "content/common/gpu/gpu_messages.h"
91 #include "content/common/resource_messages.h" 92 #include "content/common/resource_messages.h"
92 #include "content/common/view_messages.h" 93 #include "content/common/view_messages.h"
93 #include "content/public/browser/browser_context.h" 94 #include "content/public/browser/browser_context.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 315
315 // static 316 // static
316 bool g_run_renderer_in_process_ = false; 317 bool g_run_renderer_in_process_ = false;
317 318
318 // static 319 // static
319 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { 320 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
320 g_max_renderer_count_override = count; 321 g_max_renderer_count_override = count;
321 } 322 }
322 323
323 RenderProcessHostImpl::RenderProcessHostImpl( 324 RenderProcessHostImpl::RenderProcessHostImpl(
324 BrowserContext* browser_context, bool is_guest) 325 BrowserContext* browser_context,
326 StoragePartitionImpl* storage_partition_impl,
327 bool is_guest)
325 : fast_shutdown_started_(false), 328 : fast_shutdown_started_(false),
326 deleting_soon_(false), 329 deleting_soon_(false),
327 pending_views_(0), 330 pending_views_(0),
328 visible_widgets_(0), 331 visible_widgets_(0),
329 backgrounded_(true), 332 backgrounded_(true),
330 ALLOW_THIS_IN_INITIALIZER_LIST(cached_dibs_cleaner_( 333 ALLOW_THIS_IN_INITIALIZER_LIST(cached_dibs_cleaner_(
331 FROM_HERE, base::TimeDelta::FromSeconds(5), 334 FROM_HERE, base::TimeDelta::FromSeconds(5),
332 this, &RenderProcessHostImpl::ClearTransportDIBCache)), 335 this, &RenderProcessHostImpl::ClearTransportDIBCache)),
333 is_initialized_(false), 336 is_initialized_(false),
334 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), 337 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
335 browser_context_(browser_context), 338 browser_context_(browser_context),
339 storage_partition_impl_(storage_partition_impl),
336 sudden_termination_allowed_(true), 340 sudden_termination_allowed_(true),
337 ignore_input_events_(false), 341 ignore_input_events_(false),
338 is_guest_(is_guest) { 342 is_guest_(is_guest) {
339 widget_helper_ = new RenderWidgetHelper(); 343 widget_helper_ = new RenderWidgetHelper();
340 344
341 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); 345 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID());
342 346
343 // Grant most file permissions to this renderer. 347 // Grant most file permissions to this renderer.
344 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and 348 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and
345 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API 349 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 void RenderProcessHostImpl::CreateMessageFilters() { 509 void RenderProcessHostImpl::CreateMessageFilters() {
506 MediaObserver* media_observer = 510 MediaObserver* media_observer =
507 GetContentClient()->browser()->GetMediaObserver(); 511 GetContentClient()->browser()->GetMediaObserver();
508 scoped_refptr<RenderMessageFilter> render_message_filter( 512 scoped_refptr<RenderMessageFilter> render_message_filter(
509 new RenderMessageFilter( 513 new RenderMessageFilter(
510 GetID(), 514 GetID(),
511 PluginServiceImpl::GetInstance(), 515 PluginServiceImpl::GetInstance(),
512 GetBrowserContext(), 516 GetBrowserContext(),
513 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), 517 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()),
514 widget_helper_, 518 widget_helper_,
515 media_observer)); 519 media_observer,
520 storage_partition_impl_->GetDOMStorageContext()));
516 channel_->AddFilter(render_message_filter); 521 channel_->AddFilter(render_message_filter);
517 BrowserContext* browser_context = GetBrowserContext(); 522 BrowserContext* browser_context = GetBrowserContext();
518 ResourceContext* resource_context = browser_context->GetResourceContext(); 523 ResourceContext* resource_context = browser_context->GetResourceContext();
519 524
520 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( 525 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
521 GetID(), PROCESS_TYPE_RENDERER, resource_context, 526 GetID(), PROCESS_TYPE_RENDERER, resource_context,
522 new RendererURLRequestContextSelector(browser_context, GetID())); 527 new RendererURLRequestContextSelector(browser_context, GetID()));
523 528
524 channel_->AddFilter(resource_message_filter); 529 channel_->AddFilter(resource_message_filter);
525 media::AudioManager* audio_manager = BrowserMainLoop::GetAudioManager(); 530 media::AudioManager* audio_manager = BrowserMainLoop::GetAudioManager();
526 media_stream::MediaStreamManager* media_stream_manager = 531 media_stream::MediaStreamManager* media_stream_manager =
527 BrowserMainLoop::GetMediaStreamManager(); 532 BrowserMainLoop::GetMediaStreamManager();
528 channel_->AddFilter(new AudioInputRendererHost(audio_manager, 533 channel_->AddFilter(new AudioInputRendererHost(audio_manager,
529 media_stream_manager)); 534 media_stream_manager));
530 channel_->AddFilter(new AudioRendererHost(audio_manager, media_observer)); 535 channel_->AddFilter(new AudioRendererHost(audio_manager, media_observer));
531 channel_->AddFilter(new VideoCaptureHost()); 536 channel_->AddFilter(new VideoCaptureHost());
532 channel_->AddFilter(new AppCacheDispatcherHost( 537 channel_->AddFilter(new AppCacheDispatcherHost(
533 static_cast<ChromeAppCacheService*>( 538 static_cast<ChromeAppCacheService*>(
534 BrowserContext::GetAppCacheService(browser_context)), 539 BrowserContext::GetAppCacheService(browser_context)),
535 GetID())); 540 GetID()));
536 channel_->AddFilter(new ClipboardMessageFilter()); 541 channel_->AddFilter(new ClipboardMessageFilter());
537 channel_->AddFilter(new DOMStorageMessageFilter(GetID(), 542 channel_->AddFilter(
538 static_cast<DOMStorageContextImpl*>( 543 new DOMStorageMessageFilter(
539 BrowserContext::GetDOMStorageContext(browser_context, GetID())))); 544 GetID(),
545 storage_partition_impl_->GetDOMStorageContext()));
540 channel_->AddFilter(new IndexedDBDispatcherHost(GetID(), 546 channel_->AddFilter(new IndexedDBDispatcherHost(GetID(),
541 static_cast<IndexedDBContextImpl*>( 547 static_cast<IndexedDBContextImpl*>(
542 BrowserContext::GetIndexedDBContext(browser_context)))); 548 BrowserContext::GetIndexedDBContext(browser_context))));
543 channel_->AddFilter(GeolocationDispatcherHost::New( 549 channel_->AddFilter(GeolocationDispatcherHost::New(
544 GetID(), browser_context->GetGeolocationPermissionContext())); 550 GetID(), browser_context->GetGeolocationPermissionContext()));
545 gpu_message_filter_ = new GpuMessageFilter(GetID(), widget_helper_.get()); 551 gpu_message_filter_ = new GpuMessageFilter(GetID(), widget_helper_.get());
546 channel_->AddFilter(gpu_message_filter_); 552 channel_->AddFilter(gpu_message_filter_);
547 #if defined(ENABLE_WEBRTC) 553 #if defined(ENABLE_WEBRTC)
548 channel_->AddFilter(new media_stream::MediaStreamDispatcherHost(GetID())); 554 channel_->AddFilter(new media_stream::MediaStreamDispatcherHost(GetID()));
549 #endif 555 #endif
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 595
590 #if defined(ENABLE_WEBRTC) 596 #if defined(ENABLE_WEBRTC)
591 channel_->AddFilter(new P2PSocketDispatcherHost(resource_context)); 597 channel_->AddFilter(new P2PSocketDispatcherHost(resource_context));
592 #endif 598 #endif
593 599
594 channel_->AddFilter(new TraceMessageFilter()); 600 channel_->AddFilter(new TraceMessageFilter());
595 channel_->AddFilter(new ResolveProxyMsgHelper( 601 channel_->AddFilter(new ResolveProxyMsgHelper(
596 browser_context->GetRequestContextForRenderProcess(GetID()))); 602 browser_context->GetRequestContextForRenderProcess(GetID())));
597 channel_->AddFilter(new QuotaDispatcherHost( 603 channel_->AddFilter(new QuotaDispatcherHost(
598 GetID(), 604 GetID(),
599 BrowserContext::GetQuotaManager(browser_context), 605 storage_partition_impl_->GetQuotaManager(),
600 GetContentClient()->browser()->CreateQuotaPermissionContext())); 606 GetContentClient()->browser()->CreateQuotaPermissionContext()));
601 channel_->AddFilter(new GamepadBrowserMessageFilter(this)); 607 channel_->AddFilter(new GamepadBrowserMessageFilter(this));
602 channel_->AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); 608 channel_->AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER));
603 channel_->AddFilter(new content::HistogramMessageFilter()); 609 channel_->AddFilter(new content::HistogramMessageFilter());
604 } 610 }
605 611
606 int RenderProcessHostImpl::GetNextRoutingID() { 612 int RenderProcessHostImpl::GetNextRoutingID() {
607 return widget_helper_->GetNextRoutingID(); 613 return widget_helper_->GetNextRoutingID();
608 } 614 }
609 615
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 int32 route_id, 1513 int32 route_id,
1508 int32 gpu_process_host_id) { 1514 int32 gpu_process_host_id) {
1509 TRACE_EVENT0("renderer_host", 1515 TRACE_EVENT0("renderer_host",
1510 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); 1516 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
1511 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, 1517 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,
1512 gpu_process_host_id, 1518 gpu_process_host_id,
1513 0); 1519 0);
1514 } 1520 }
1515 1521
1516 } // namespace content 1522 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/renderer_host/test_render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698