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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp

Issue 2948983002: Low memory page navigation GC for low end devices (Closed)
Patch Set: fix Created 3 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "bindings/core/v8/WindowProxyManager.h" 5 #include "bindings/core/v8/WindowProxyManager.h"
6 6
7 #include "platform/bindings/DOMWrapperWorld.h" 7 #include "platform/bindings/DOMWrapperWorld.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 DEFINE_TRACE(WindowProxyManager) { 11 DEFINE_TRACE(WindowProxyManager) {
12 visitor->Trace(frame_); 12 visitor->Trace(frame_);
13 visitor->Trace(window_proxy_); 13 visitor->Trace(window_proxy_);
14 visitor->Trace(isolated_worlds_); 14 visitor->Trace(isolated_worlds_);
15 } 15 }
16 16
17 void WindowProxyManager::ClearForClose() { 17 void WindowProxyManager::ClearForClose() {
18 window_proxy_->ClearForClose(); 18 window_proxy_->ClearForClose();
19 for (auto& entry : isolated_worlds_) 19 for (auto& entry : isolated_worlds_)
20 entry.value->ClearForClose(); 20 entry.value->ClearForClose();
21 } 21 }
22 22
23 void WindowProxyManager::ClearForNavigation() { 23 void WindowProxyManager::ClearForNavigation() {
24 window_proxy_->ClearForNavigation(); 24 window_proxy_->ClearForNavigation();
25 for (auto& entry : isolated_worlds_) 25 for (auto& entry : isolated_worlds_)
26 entry.value->ClearForNavigation(); 26 entry.value->ClearForNavigation();
27 } 27 }
28 28
29 void WindowProxyManager::ClearForSwap() {
30 window_proxy_->ClearForSwap();
31 for (auto& entry : isolated_worlds_)
32 entry.value->ClearForSwap();
33 }
34
29 void WindowProxyManager::ReleaseGlobalProxies( 35 void WindowProxyManager::ReleaseGlobalProxies(
30 GlobalProxyVector& global_proxies) { 36 GlobalProxyVector& global_proxies) {
31 DCHECK(global_proxies.IsEmpty()); 37 DCHECK(global_proxies.IsEmpty());
32 global_proxies.ReserveInitialCapacity(1 + isolated_worlds_.size()); 38 global_proxies.ReserveInitialCapacity(1 + isolated_worlds_.size());
33 global_proxies.emplace_back(&window_proxy_->World(), 39 global_proxies.emplace_back(&window_proxy_->World(),
34 window_proxy_->ReleaseGlobalProxy()); 40 window_proxy_->ReleaseGlobalProxy());
35 for (auto& entry : isolated_worlds_) { 41 for (auto& entry : isolated_worlds_) {
36 global_proxies.emplace_back( 42 global_proxies.emplace_back(
37 &entry.value->World(), 43 &entry.value->World(),
38 WindowProxyMaybeUninitialized(entry.value->World()) 44 WindowProxyMaybeUninitialized(entry.value->World())
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 for (auto& entry : isolated_worlds_) { 101 for (auto& entry : isolated_worlds_) {
96 auto* isolated_window_proxy = 102 auto* isolated_window_proxy =
97 static_cast<LocalWindowProxy*>(entry.value.Get()); 103 static_cast<LocalWindowProxy*>(entry.value.Get());
98 SecurityOrigin* isolated_security_origin = 104 SecurityOrigin* isolated_security_origin =
99 isolated_window_proxy->World().IsolatedWorldSecurityOrigin(); 105 isolated_window_proxy->World().IsolatedWorldSecurityOrigin();
100 isolated_window_proxy->UpdateSecurityOrigin(isolated_security_origin); 106 isolated_window_proxy->UpdateSecurityOrigin(isolated_security_origin);
101 } 107 }
102 } 108 }
103 109
104 } // namespace blink 110 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h ('k') | third_party/WebKit/Source/core/exported/WebFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698