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

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

Issue 2577353002: memory coordinator: Sends notifications to V8 on THROTTLED state (Closed)
Patch Set: rebase Created 4 years 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 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 if (blink_platform_impl_) { 2257 if (blink_platform_impl_) {
2258 blink::WebMemoryCoordinator::onMemoryStateChange( 2258 blink::WebMemoryCoordinator::onMemoryStateChange(
2259 static_cast<blink::MemoryState>(state)); 2259 static_cast<blink::MemoryState>(state));
2260 } 2260 }
2261 switch (state) { 2261 switch (state) {
2262 case base::MemoryState::NORMAL: 2262 case base::MemoryState::NORMAL:
2263 ResumeRenderer(); 2263 ResumeRenderer();
2264 break; 2264 break;
2265 case base::MemoryState::THROTTLED: 2265 case base::MemoryState::THROTTLED:
2266 ResumeRenderer(); 2266 ResumeRenderer();
2267 // TODO(bashi): Figure out what kind of strategy is suitable on
2268 // THROTTLED state. crbug.com/674815
2269 #if defined(OS_ANDROID)
2270 OnTrimMemoryImmediately();
2271 #else
2272 OnSyncMemoryPressure(
2273 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE);
2274 #endif
2267 ReleaseFreeMemory(); 2275 ReleaseFreeMemory();
2268 break; 2276 break;
2269 case base::MemoryState::SUSPENDED: 2277 case base::MemoryState::SUSPENDED:
2270 SuspendRenderer(); 2278 SuspendRenderer();
2271 break; 2279 break;
2272 case base::MemoryState::UNKNOWN: 2280 case base::MemoryState::UNKNOWN:
2273 NOTREACHED(); 2281 NOTREACHED();
2274 break; 2282 break;
2275 } 2283 }
2276 } 2284 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 } 2486 }
2479 } 2487 }
2480 2488
2481 void RenderThreadImpl::OnRendererInterfaceRequest( 2489 void RenderThreadImpl::OnRendererInterfaceRequest(
2482 mojom::RendererAssociatedRequest request) { 2490 mojom::RendererAssociatedRequest request) {
2483 DCHECK(!renderer_binding_.is_bound()); 2491 DCHECK(!renderer_binding_.is_bound());
2484 renderer_binding_.Bind(std::move(request)); 2492 renderer_binding_.Bind(std::move(request));
2485 } 2493 }
2486 2494
2487 } // namespace content 2495 } // 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