| OLD | NEW |
| 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/debug/trace_event_synthetic_delay.h" | 10 #include "base/debug/trace_event_synthetic_delay.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 // If we are swapping out, we will call ReleaseProcess, allowing the process | 505 // If we are swapping out, we will call ReleaseProcess, allowing the process |
| 506 // to exit if all of its RenderViews are swapped out. We wait until the | 506 // to exit if all of its RenderViews are swapped out. We wait until the |
| 507 // WasSwappedOut call to do this, to avoid showing the sad tab. | 507 // WasSwappedOut call to do this, to avoid showing the sad tab. |
| 508 // If we are swapping in, we call AddRefProcess to prevent the process from | 508 // If we are swapping in, we call AddRefProcess to prevent the process from |
| 509 // exiting. | 509 // exiting. |
| 510 if (!is_swapped_out) | 510 if (!is_swapped_out) |
| 511 RenderProcess::current()->AddRefProcess(); | 511 RenderProcess::current()->AddRefProcess(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 bool RenderWidget::AllowPartialSwap() const { | |
| 515 return true; | |
| 516 } | |
| 517 | |
| 518 bool RenderWidget::UsingSynchronousRendererCompositor() const { | 514 bool RenderWidget::UsingSynchronousRendererCompositor() const { |
| 519 #if defined(OS_ANDROID) | 515 #if defined(OS_ANDROID) |
| 520 return SynchronousCompositorFactory::GetInstance() != NULL; | 516 return SynchronousCompositorFactory::GetInstance() != NULL; |
| 521 #else | 517 #else |
| 522 return false; | 518 return false; |
| 523 #endif | 519 #endif |
| 524 } | 520 } |
| 525 | 521 |
| 526 void RenderWidget::EnableScreenMetricsEmulation( | 522 void RenderWidget::EnableScreenMetricsEmulation( |
| 527 const gfx::Rect& device_rect, | 523 const gfx::Rect& device_rect, |
| (...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2787 | 2783 |
| 2788 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2784 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
| 2789 swapped_out_frames_.AddObserver(frame); | 2785 swapped_out_frames_.AddObserver(frame); |
| 2790 } | 2786 } |
| 2791 | 2787 |
| 2792 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2788 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
| 2793 swapped_out_frames_.RemoveObserver(frame); | 2789 swapped_out_frames_.RemoveObserver(frame); |
| 2794 } | 2790 } |
| 2795 | 2791 |
| 2796 } // namespace content | 2792 } // namespace content |
| OLD | NEW |