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

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

Issue 2496863003: Invoke OnTrimMemoryImmediately when memory state is SUSPENDED (Closed)
Patch Set: Rebaselined Created 4 years, 1 month 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 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2280 blink::WebMemoryCoordinator::onMemoryStateChange( 2280 blink::WebMemoryCoordinator::onMemoryStateChange(
2281 static_cast<blink::MemoryState>(state)); 2281 static_cast<blink::MemoryState>(state));
2282 } 2282 }
2283 switch (state) { 2283 switch (state) {
2284 case base::MemoryState::NORMAL: 2284 case base::MemoryState::NORMAL:
2285 break; 2285 break;
2286 case base::MemoryState::THROTTLED: 2286 case base::MemoryState::THROTTLED:
2287 ReleaseFreeMemory(); 2287 ReleaseFreeMemory();
2288 break; 2288 break;
2289 case base::MemoryState::SUSPENDED: 2289 case base::MemoryState::SUSPENDED:
2290 OnTrimMemoryImmediately();
2290 ReleaseFreeMemory(); 2291 ReleaseFreeMemory();
2291 ClearMemory(); 2292 ClearMemory();
2292 break; 2293 break;
2293 case base::MemoryState::UNKNOWN: 2294 case base::MemoryState::UNKNOWN:
2294 NOTREACHED(); 2295 NOTREACHED();
2295 break; 2296 break;
2296 } 2297 }
2297 } 2298 }
2298 2299
2299 void RenderThreadImpl::ClearMemory() { 2300 void RenderThreadImpl::ClearMemory() {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 } 2487 }
2487 } 2488 }
2488 2489
2489 void RenderThreadImpl::OnRendererInterfaceRequest( 2490 void RenderThreadImpl::OnRendererInterfaceRequest(
2490 mojom::RendererAssociatedRequest request) { 2491 mojom::RendererAssociatedRequest request) {
2491 DCHECK(!renderer_binding_.is_bound()); 2492 DCHECK(!renderer_binding_.is_bound());
2492 renderer_binding_.Bind(std::move(request)); 2493 renderer_binding_.Bind(std::move(request));
2493 } 2494 }
2494 2495
2495 } // namespace content 2496 } // 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