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

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

Issue 14947002: Updated OSX to blacklist multisampling when multiple monitors are connected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback Created 7 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
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 #include <algorithm> 10 #include <algorithm>
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 is_initialized_(false), 389 is_initialized_(false),
390 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), 390 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
391 browser_context_(browser_context), 391 browser_context_(browser_context),
392 storage_partition_impl_(storage_partition_impl), 392 storage_partition_impl_(storage_partition_impl),
393 sudden_termination_allowed_(true), 393 sudden_termination_allowed_(true),
394 ignore_input_events_(false), 394 ignore_input_events_(false),
395 #if defined(OS_ANDROID) 395 #if defined(OS_ANDROID)
396 dummy_shutdown_event_(false, false), 396 dummy_shutdown_event_(false, false),
397 #endif 397 #endif
398 supports_browser_plugin_(supports_browser_plugin), 398 supports_browser_plugin_(supports_browser_plugin),
399 is_guest_(is_guest) { 399 is_guest_(is_guest),
400 gpu_switch_callback_(base::Bind(&RenderProcessHostImpl::OnGpuSwitch,
401 base::Unretained(this))) {
400 widget_helper_ = new RenderWidgetHelper(); 402 widget_helper_ = new RenderWidgetHelper();
401 403
402 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); 404 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID());
403 405
404 CHECK(!g_exited_main_message_loop); 406 CHECK(!g_exited_main_message_loop);
405 RegisterHost(GetID(), this); 407 RegisterHost(GetID(), this);
406 g_all_hosts.Get().set_check_on_null_data(true); 408 g_all_hosts.Get().set_check_on_null_data(true);
407 // Initialize |child_process_activity_time_| to a reasonable value. 409 // Initialize |child_process_activity_time_| to a reasonable value.
408 mark_child_process_activity_time(); 410 mark_child_process_activity_time();
409 411
410 if (!GetBrowserContext()->IsOffTheRecord() && 412 if (!GetBrowserContext()->IsOffTheRecord() &&
411 !CommandLine::ForCurrentProcess()->HasSwitch( 413 !CommandLine::ForCurrentProcess()->HasSwitch(
412 switches::kDisableGpuShaderDiskCache)) { 414 switches::kDisableGpuShaderDiskCache)) {
413 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 415 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
414 base::Bind(&CacheShaderInfo, GetID(), 416 base::Bind(&CacheShaderInfo, GetID(),
415 storage_partition_impl_->GetPath())); 417 storage_partition_impl_->GetPath()));
416 } 418 }
417 419
418 // Note: When we create the RenderProcessHostImpl, it's technically 420 // Note: When we create the RenderProcessHostImpl, it's technically
419 // backgrounded, because it has no visible listeners. But the process 421 // backgrounded, because it has no visible listeners. But the process
420 // doesn't actually exist yet, so we'll Background it later, after 422 // doesn't actually exist yet, so we'll Background it later, after
421 // creation. 423 // creation.
422 } 424 }
423 425
424 RenderProcessHostImpl::~RenderProcessHostImpl() { 426 RenderProcessHostImpl::~RenderProcessHostImpl() {
425 DCHECK(!run_renderer_in_process()); 427 DCHECK(!run_renderer_in_process());
426 ChildProcessSecurityPolicyImpl::GetInstance()->Remove(GetID()); 428 ChildProcessSecurityPolicyImpl::GetInstance()->Remove(GetID());
429 GpuDataManagerImpl::GetInstance()->RemoveGpuSwitchCallback(
430 gpu_switch_callback_);
427 431
428 // We may have some unsent messages at this point, but that's OK. 432 // We may have some unsent messages at this point, but that's OK.
429 channel_.reset(); 433 channel_.reset();
430 while (!queued_messages_.empty()) { 434 while (!queued_messages_.empty()) {
431 delete queued_messages_.front(); 435 delete queued_messages_.front();
432 queued_messages_.pop(); 436 queued_messages_.pop();
433 } 437 }
434 438
435 ClearTransportDIBCache(); 439 ClearTransportDIBCache();
436 UnregisterHost(GetID()); 440 UnregisterHost(GetID());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 base::EnvironmentVector(), 545 base::EnvironmentVector(),
542 channel_->TakeClientFileDescriptor(), 546 channel_->TakeClientFileDescriptor(),
543 #endif 547 #endif
544 cmd_line, 548 cmd_line,
545 GetID(), 549 GetID(),
546 this)); 550 this));
547 551
548 fast_shutdown_started_ = false; 552 fast_shutdown_started_ = false;
549 } 553 }
550 554
555 GpuDataManagerImpl::GetInstance()->AddGpuSwitchCallback(gpu_switch_callback_);
556
551 is_initialized_ = true; 557 is_initialized_ = true;
552 return true; 558 return true;
553 } 559 }
554 560
555 void RenderProcessHostImpl::CreateMessageFilters() { 561 void RenderProcessHostImpl::CreateMessageFilters() {
556 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 562 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
557 channel_->AddFilter(new ResourceSchedulerFilter(GetID())); 563 channel_->AddFilter(new ResourceSchedulerFilter(GetID()));
558 MediaInternals* media_internals = MediaInternals::GetInstance();; 564 MediaInternals* media_internals = MediaInternals::GetInstance();;
559 // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages 565 // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
560 // from guests. 566 // from guests.
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 int32 gpu_process_host_id) { 1751 int32 gpu_process_host_id) {
1746 TRACE_EVENT0("renderer_host", 1752 TRACE_EVENT0("renderer_host",
1747 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); 1753 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
1748 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; 1754 AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
1749 ack_params.sync_point = 0; 1755 ack_params.sync_point = 0;
1750 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, 1756 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,
1751 gpu_process_host_id, 1757 gpu_process_host_id,
1752 ack_params); 1758 ack_params);
1753 } 1759 }
1754 1760
1761 void RenderProcessHostImpl::OnGpuSwitch() {
1762 for (RenderWidgetHostsIterator iter = GetRenderWidgetHostsIterator();
1763 !iter.IsAtEnd();
1764 iter.Advance()) {
1765 const RenderWidgetHost* widget = iter.GetCurrentValue();
1766 DCHECK(widget);
1767 if (!widget || !widget->IsRenderView())
1768 continue;
1769
1770 RenderViewHost* rvh =
1771 RenderViewHost::From(const_cast<RenderWidgetHost*>(widget));
1772
1773 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences());
1774 }
1775 }
1776
1755 } // namespace content 1777 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698