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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2387603003: Resume a backgrounded renderer that was purged and suspended (Closed)
Patch Set: Add purge-and-suspend state and last modified time to WebContentsData Created 4 years, 2 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 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 // memory-infra. 1885 // memory-infra.
1886 UMA_HISTOGRAM_MEMORY_MB("PurgeAndSuspend.Memory.V8MainThreadIsolateMB", 1886 UMA_HISTOGRAM_MEMORY_MB("PurgeAndSuspend.Memory.V8MainThreadIsolateMB",
1887 v8_usage / 1024 / 1024); 1887 v8_usage / 1024 / 1024);
1888 UMA_HISTOGRAM_MEMORY_MB("PurgeAndSuspend.Memory.TotalAllocatedMB", 1888 UMA_HISTOGRAM_MEMORY_MB("PurgeAndSuspend.Memory.TotalAllocatedMB",
1889 (blink_stats.partitionAllocTotalAllocatedBytes + 1889 (blink_stats.partitionAllocTotalAllocatedBytes +
1890 blink_stats.blinkGCTotalAllocatedBytes + 1890 blink_stats.blinkGCTotalAllocatedBytes +
1891 malloc_usage + v8_usage + discardable_usage) / 1891 malloc_usage + v8_usage + discardable_usage) /
1892 1024 / 1024); 1892 1024 / 1024);
1893 } 1893 }
1894 1894
1895 void RenderThreadImpl::OnProcessResume() {
1896 ChildThreadImpl::OnProcessResume();
1897 if (!is_renderer_suspended_)
1898 return;
1899
1900 is_renderer_suspended_ = false;
1901 renderer_scheduler_->ResumeRenderer();
1902 }
1903
1895 scoped_refptr<gpu::GpuChannelHost> RenderThreadImpl::EstablishGpuChannelSync() { 1904 scoped_refptr<gpu::GpuChannelHost> RenderThreadImpl::EstablishGpuChannelSync() {
1896 TRACE_EVENT0("gpu", "RenderThreadImpl::EstablishGpuChannelSync"); 1905 TRACE_EVENT0("gpu", "RenderThreadImpl::EstablishGpuChannelSync");
1897 1906
1898 if (gpu_channel_) { 1907 if (gpu_channel_) {
1899 // Do nothing if we already have a GPU channel or are already 1908 // Do nothing if we already have a GPU channel or are already
1900 // establishing one. 1909 // establishing one.
1901 if (!gpu_channel_->IsLost()) 1910 if (!gpu_channel_->IsLost())
1902 return gpu_channel_; 1911 return gpu_channel_;
1903 1912
1904 // Recreate the channel if it has been lost. 1913 // Recreate the channel if it has been lost.
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 } 2485 }
2477 } 2486 }
2478 2487
2479 void RenderThreadImpl::OnRendererInterfaceRequest( 2488 void RenderThreadImpl::OnRendererInterfaceRequest(
2480 mojom::RendererAssociatedRequest request) { 2489 mojom::RendererAssociatedRequest request) {
2481 DCHECK(!renderer_binding_.is_bound()); 2490 DCHECK(!renderer_binding_.is_bound());
2482 renderer_binding_.Bind(std::move(request)); 2491 renderer_binding_.Bind(std::move(request));
2483 } 2492 }
2484 2493
2485 } // namespace content 2494 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698