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

Side by Side Diff: third_party/WebKit/public/web/WebFrame.h

Issue 2706963004: Clear opener when frame is detached. (Closed)
Patch Set: addressing comments Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | 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 /* 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 virtual bool isWebLocalFrame() const = 0; 105 virtual bool isWebLocalFrame() const = 0;
106 virtual WebLocalFrame* toWebLocalFrame() = 0; 106 virtual WebLocalFrame* toWebLocalFrame() = 0;
107 virtual bool isWebRemoteFrame() const = 0; 107 virtual bool isWebRemoteFrame() const = 0;
108 virtual WebRemoteFrame* toWebRemoteFrame() = 0; 108 virtual WebRemoteFrame* toWebRemoteFrame() = 0;
109 109
110 BLINK_EXPORT bool swap(WebFrame*); 110 BLINK_EXPORT bool swap(WebFrame*);
111 111
112 // This method closes and deletes the WebFrame. This is typically called by 112 // This method closes and deletes the WebFrame. This is typically called by
113 // the embedder in response to a frame detached callback to the WebFrame 113 // the embedder in response to a frame detached callback to the WebFrame
114 // client. 114 // client.
115 virtual void close() = 0; 115 virtual void close();
116 116
117 // Called by the embedder when it needs to detach the subtree rooted at this 117 // Called by the embedder when it needs to detach the subtree rooted at this
118 // frame. 118 // frame.
119 BLINK_EXPORT void detach(); 119 BLINK_EXPORT void detach();
120 120
121 // Basic properties --------------------------------------------------- 121 // Basic properties ---------------------------------------------------
122 122
123 // The unique name of this frame. 123 // The unique name of this frame.
124 virtual WebString uniqueName() const = 0; 124 virtual WebString uniqueName() const = 0;
125 125
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // Returns the frame inside a given frame or iframe element. Returns 0 if 432 // Returns the frame inside a given frame or iframe element. Returns 0 if
433 // the given element is not a frame, iframe or if the frame is empty. 433 // the given element is not a frame, iframe or if the frame is empty.
434 BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); 434 BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&);
435 435
436 #if BLINK_IMPLEMENTATION 436 #if BLINK_IMPLEMENTATION
437 static WebFrame* fromFrame(Frame*); 437 static WebFrame* fromFrame(Frame*);
438 438
439 bool inShadowTree() const { return m_scope == WebTreeScopeType::Shadow; } 439 bool inShadowTree() const { return m_scope == WebTreeScopeType::Shadow; }
440 440
441 static void traceFrames(Visitor*, WebFrame*); 441 static void traceFrames(Visitor*, WebFrame*);
442 void clearWeakFrames(Visitor*);
443 #endif 442 #endif
444 443
445 protected: 444 protected:
446 explicit WebFrame(WebTreeScopeType); 445 explicit WebFrame(WebTreeScopeType);
447 virtual ~WebFrame(); 446 virtual ~WebFrame();
448 447
449 // Sets the parent WITHOUT fulling adding it to the frame tree. 448 // Sets the parent WITHOUT fulling adding it to the frame tree.
450 // Used to lie to a local frame that is replacing a remote frame, 449 // Used to lie to a local frame that is replacing a remote frame,
451 // so it can properly start a navigation but wait to swap until 450 // so it can properly start a navigation but wait to swap until
452 // commit-time. 451 // commit-time.
453 void setParent(WebFrame*); 452 void setParent(WebFrame*);
454 453
455 private: 454 private:
456 #if BLINK_IMPLEMENTATION 455 #if BLINK_IMPLEMENTATION
457 friend class OpenedFrameTracker; 456 friend class OpenedFrameTracker;
458 friend class WebFrameTest; 457 friend class WebFrameTest;
459 458
460 static void traceFrame(Visitor*, WebFrame*); 459 static void traceFrame(Visitor*, WebFrame*);
461 static bool isFrameAlive(const WebFrame*);
462 #endif 460 #endif
463 461
464 const WebTreeScopeType m_scope; 462 const WebTreeScopeType m_scope;
465 463
466 WebFrame* m_parent; 464 WebFrame* m_parent;
467 WebFrame* m_previousSibling; 465 WebFrame* m_previousSibling;
468 WebFrame* m_nextSibling; 466 WebFrame* m_nextSibling;
469 WebFrame* m_firstChild; 467 WebFrame* m_firstChild;
470 WebFrame* m_lastChild; 468 WebFrame* m_lastChild;
471 469
472 WebFrame* m_opener; 470 WebFrame* m_opener;
473 std::unique_ptr<OpenedFrameTracker> m_openedFrameTracker; 471 std::unique_ptr<OpenedFrameTracker> m_openedFrameTracker;
474 }; 472 };
475 473
476 } // namespace blink 474 } // namespace blink
477 475
478 #endif 476 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698