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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.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 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 WindowProxy::WindowProxy(v8::Isolate* isolate, 56 WindowProxy::WindowProxy(v8::Isolate* isolate,
57 Frame& frame, 57 Frame& frame,
58 RefPtr<DOMWrapperWorld> world) 58 RefPtr<DOMWrapperWorld> world)
59 : isolate_(isolate), 59 : isolate_(isolate),
60 frame_(frame), 60 frame_(frame),
61 61
62 world_(std::move(world)), 62 world_(std::move(world)),
63 lifecycle_(Lifecycle::kContextIsUninitialized) {} 63 lifecycle_(Lifecycle::kContextIsUninitialized) {}
64 64
65 void WindowProxy::ClearForClose() { 65 void WindowProxy::ClearForClose() {
66 DisposeContext(Lifecycle::kFrameIsDetached); 66 DisposeContext(Lifecycle::kFrameIsDetached, kFrameWillNotBeReused);
67 } 67 }
68 68
69 void WindowProxy::ClearForNavigation() { 69 void WindowProxy::ClearForNavigation() {
70 DisposeContext(Lifecycle::kGlobalObjectIsDetached); 70 DisposeContext(Lifecycle::kGlobalObjectIsDetached, kFrameWillBeReused);
71 }
72
73 void WindowProxy::ClearForSwap() {
74 DisposeContext(Lifecycle::kGlobalObjectIsDetached, kFrameWillNotBeReused);
71 } 75 }
72 76
73 v8::Local<v8::Object> WindowProxy::GlobalProxyIfNotDetached() { 77 v8::Local<v8::Object> WindowProxy::GlobalProxyIfNotDetached() {
74 if (lifecycle_ == Lifecycle::kContextIsInitialized) { 78 if (lifecycle_ == Lifecycle::kContextIsInitialized) {
75 DLOG_IF(FATAL, !is_global_object_attached_) 79 DLOG_IF(FATAL, !is_global_object_attached_)
76 << "Context is initialized but global object is detached!"; 80 << "Context is initialized but global object is detached!";
77 return global_proxy_.NewLocal(isolate_); 81 return global_proxy_.NewLocal(isolate_);
78 } 82 }
79 return v8::Local<v8::Object>(); 83 return v8::Local<v8::Object>();
80 } 84 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 wrapper)) { 165 wrapper)) {
162 WrapperTypeInfo::WrapperCreated(); 166 WrapperTypeInfo::WrapperCreated();
163 V8DOMWrapper::SetNativeInfo(isolate_, wrapper, wrapper_type_info, window); 167 V8DOMWrapper::SetNativeInfo(isolate_, wrapper, wrapper_type_info, window);
164 DCHECK(V8DOMWrapper::HasInternalFieldsSet(wrapper)); 168 DCHECK(V8DOMWrapper::HasInternalFieldsSet(wrapper));
165 } 169 }
166 SECURITY_CHECK(ToScriptWrappable(wrapper) == window); 170 SECURITY_CHECK(ToScriptWrappable(wrapper) == window);
167 return wrapper; 171 return wrapper;
168 } 172 }
169 173
170 } // namespace blink 174 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698