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

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

Issue 2693223003: Revert of Add ChildMemoryCoordinator::PurgeMemory() (Closed)
Patch Set: Reduce to revert only the RenderThreadImpl change Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 void RenderThreadImpl::OnProcessPurgeAndSuspend() { 1655 void RenderThreadImpl::OnProcessPurgeAndSuspend() {
1656 ChildThreadImpl::OnProcessPurgeAndSuspend(); 1656 ChildThreadImpl::OnProcessPurgeAndSuspend();
1657 if (!RendererIsHidden()) 1657 if (!RendererIsHidden())
1658 return; 1658 return;
1659 1659
1660 // TODO(bashi): Enable the tab suspension when MemoryCoordinator is enabled. 1660 // TODO(bashi): Enable the tab suspension when MemoryCoordinator is enabled.
1661 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) 1661 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator))
1662 return; 1662 return;
1663 1663
1664 if (base::FeatureList::IsEnabled(features::kPurgeAndSuspend)) { 1664 if (base::FeatureList::IsEnabled(features::kPurgeAndSuspend)) {
1665 memory_coordinator_->PurgeMemory(); 1665 // TODO(tasak): After enabling MemoryCoordinator, remove this Notify
1666 // and follow MemoryCoordinator's request.
1667 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1666 } 1668 }
1667 // Since purging is not a synchronous task (e.g. v8 GC, oilpan GC, ...), 1669 // Since purging is not a synchronous task (e.g. v8 GC, oilpan GC, ...),
1668 // we need to wait until the task is finished. So wait 15 seconds and 1670 // we need to wait until the task is finished. So wait 15 seconds and
1669 // update purge+suspend UMA histogram. 1671 // update purge+suspend UMA histogram.
1670 // TODO(tasak): use MemoryCoordinator's callback to report purge+suspend 1672 // TODO(tasak): use MemoryCoordinator's callback to report purge+suspend
1671 // UMA when MemoryCoordinator is available. 1673 // UMA when MemoryCoordinator is available.
1672 GetRendererScheduler()->DefaultTaskRunner()->PostDelayedTask( 1674 GetRendererScheduler()->DefaultTaskRunner()->PostDelayedTask(
1673 FROM_HERE, record_purge_suspend_metric_closure_.callback(), 1675 FROM_HERE, record_purge_suspend_metric_closure_.callback(),
1674 base::TimeDelta::FromSeconds(15)); 1676 base::TimeDelta::FromSeconds(15));
1675 needs_to_record_first_active_paint_ = true; 1677 needs_to_record_first_active_paint_ = true;
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 } 2414 }
2413 } 2415 }
2414 2416
2415 void RenderThreadImpl::OnRendererInterfaceRequest( 2417 void RenderThreadImpl::OnRendererInterfaceRequest(
2416 mojom::RendererAssociatedRequest request) { 2418 mojom::RendererAssociatedRequest request) {
2417 DCHECK(!renderer_binding_.is_bound()); 2419 DCHECK(!renderer_binding_.is_bound());
2418 renderer_binding_.Bind(std::move(request)); 2420 renderer_binding_.Bind(std::move(request));
2419 } 2421 }
2420 2422
2421 } // namespace content 2423 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698