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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.h

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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 class WindowProxy : public GarbageCollectedFinalized<WindowProxy> { 144 class WindowProxy : public GarbageCollectedFinalized<WindowProxy> {
145 public: 145 public:
146 virtual ~WindowProxy(); 146 virtual ~WindowProxy();
147 147
148 DECLARE_TRACE(); 148 DECLARE_TRACE();
149 149
150 void InitializeIfNeeded(); 150 void InitializeIfNeeded();
151 151
152 void ClearForClose(); 152 void ClearForClose();
153 void ClearForNavigation(); 153 void ClearForNavigation();
154 void ClearForSwap();
154 155
155 CORE_EXPORT v8::Local<v8::Object> GlobalProxyIfNotDetached(); 156 CORE_EXPORT v8::Local<v8::Object> GlobalProxyIfNotDetached();
156 v8::Local<v8::Object> ReleaseGlobalProxy(); 157 v8::Local<v8::Object> ReleaseGlobalProxy();
157 void SetGlobalProxy(v8::Local<v8::Object>); 158 void SetGlobalProxy(v8::Local<v8::Object>);
158 159
159 // TODO(dcheng): Temporarily exposed to avoid include cycles. Remove the need 160 // TODO(dcheng): Temporarily exposed to avoid include cycles. Remove the need
160 // for this and remove this getter. 161 // for this and remove this getter.
161 DOMWrapperWorld& World() { return *world_; } 162 DOMWrapperWorld& World() { return *world_; }
162 163
163 virtual bool IsLocal() const { return false; } 164 virtual bool IsLocal() const { return false; }
164 165
166 enum FrameReuseStatus { kFrameWillNotBeReused, kFrameWillBeReused };
167
165 protected: 168 protected:
166 // Lifecycle represents the following four states. 169 // Lifecycle represents the following four states.
167 // 170 //
168 // * kContextIsUninitialized 171 // * kContextIsUninitialized
169 // We lazily initialize WindowProxies for performance reasons, and this state 172 // We lazily initialize WindowProxies for performance reasons, and this state
170 // is "to be initialized on demand". WindowProxy basically behaves the same as 173 // is "to be initialized on demand". WindowProxy basically behaves the same as
171 // |kContextIsInitialized| from a point of view of call sites. 174 // |kContextIsInitialized| from a point of view of call sites.
172 // - Possible next states: kContextIsInitialized 175 // - Possible next states: kContextIsInitialized
173 // It's possible to detach the context's frame from the DOM or navigate to a 176 // It's possible to detach the context's frame from the DOM or navigate to a
174 // new page without initializing the WindowProxy, however, there is no 177 // new page without initializing the WindowProxy, however, there is no
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // global). 223 // global).
221 kGlobalObjectIsDetached, 224 kGlobalObjectIsDetached,
222 // The context's frame is detached from the DOM. 225 // The context's frame is detached from the DOM.
223 kFrameIsDetached, 226 kFrameIsDetached,
224 }; 227 };
225 228
226 WindowProxy(v8::Isolate*, Frame&, RefPtr<DOMWrapperWorld>); 229 WindowProxy(v8::Isolate*, Frame&, RefPtr<DOMWrapperWorld>);
227 230
228 virtual void Initialize() = 0; 231 virtual void Initialize() = 0;
229 232
230 virtual void DisposeContext(Lifecycle next_status) = 0; 233 virtual void DisposeContext(Lifecycle next_status, FrameReuseStatus) = 0;
231 234
232 WARN_UNUSED_RESULT v8::Local<v8::Object> AssociateWithWrapper( 235 WARN_UNUSED_RESULT v8::Local<v8::Object> AssociateWithWrapper(
233 DOMWindow*, 236 DOMWindow*,
234 const WrapperTypeInfo*, 237 const WrapperTypeInfo*,
235 v8::Local<v8::Object> wrapper); 238 v8::Local<v8::Object> wrapper);
236 239
237 v8::Isolate* GetIsolate() const { return isolate_; } 240 v8::Isolate* GetIsolate() const { return isolate_; }
238 Frame* GetFrame() const { return frame_.Get(); } 241 Frame* GetFrame() const { return frame_.Get(); }
239 242
240 #if DCHECK_IS_ON() 243 #if DCHECK_IS_ON()
(...skipping 19 matching lines...) Expand all
260 Lifecycle lifecycle_; 263 Lifecycle lifecycle_;
261 264
262 // TODO(dcheng): Remove this temporary code for debugging 265 // TODO(dcheng): Remove this temporary code for debugging
263 // https://crbug.com/728693. 266 // https://crbug.com/728693.
264 WTF::debug::StackTrace initialization_stack_; 267 WTF::debug::StackTrace initialization_stack_;
265 }; 268 };
266 269
267 } // namespace blink 270 } // namespace blink
268 271
269 #endif // WindowProxy_h 272 #endif // WindowProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698