OLD | NEW |
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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 static void traceFrames(InlinedGlobalMarkingVisitor, WebFrame*); | |
443 void clearWeakFrames(Visitor*); | 442 void clearWeakFrames(Visitor*); |
444 void clearWeakFrames(InlinedGlobalMarkingVisitor); | |
445 #endif | 443 #endif |
446 | 444 |
447 protected: | 445 protected: |
448 explicit WebFrame(WebTreeScopeType); | 446 explicit WebFrame(WebTreeScopeType); |
449 virtual ~WebFrame(); | 447 virtual ~WebFrame(); |
450 | 448 |
451 // Sets the parent WITHOUT fulling adding it to the frame tree. | 449 // Sets the parent WITHOUT fulling adding it to the frame tree. |
452 // Used to lie to a local frame that is replacing a remote frame, | 450 // Used to lie to a local frame that is replacing a remote frame, |
453 // so it can properly start a navigation but wait to swap until | 451 // so it can properly start a navigation but wait to swap until |
454 // commit-time. | 452 // commit-time. |
455 void setParent(WebFrame*); | 453 void setParent(WebFrame*); |
456 | 454 |
457 private: | 455 private: |
458 #if BLINK_IMPLEMENTATION | 456 #if BLINK_IMPLEMENTATION |
459 friend class OpenedFrameTracker; | 457 friend class OpenedFrameTracker; |
460 friend class WebFrameTest; | 458 friend class WebFrameTest; |
461 | 459 |
462 static void traceFrame(Visitor*, WebFrame*); | 460 static void traceFrame(Visitor*, WebFrame*); |
463 static void traceFrame(InlinedGlobalMarkingVisitor, WebFrame*); | |
464 static bool isFrameAlive(const WebFrame*); | 461 static bool isFrameAlive(const WebFrame*); |
465 | 462 |
466 template <typename VisitorDispatcher> | 463 template <typename VisitorDispatcher> |
467 static void traceFramesImpl(VisitorDispatcher, WebFrame*); | 464 static void traceFramesImpl(VisitorDispatcher, WebFrame*); |
468 template <typename VisitorDispatcher> | 465 template <typename VisitorDispatcher> |
469 void clearWeakFramesImpl(VisitorDispatcher); | 466 void clearWeakFramesImpl(VisitorDispatcher); |
470 template <typename VisitorDispatcher> | 467 template <typename VisitorDispatcher> |
471 static void traceFrameImpl(VisitorDispatcher, WebFrame*); | 468 static void traceFrameImpl(VisitorDispatcher, WebFrame*); |
472 #endif | 469 #endif |
473 | 470 |
474 const WebTreeScopeType m_scope; | 471 const WebTreeScopeType m_scope; |
475 | 472 |
476 WebFrame* m_parent; | 473 WebFrame* m_parent; |
477 WebFrame* m_previousSibling; | 474 WebFrame* m_previousSibling; |
478 WebFrame* m_nextSibling; | 475 WebFrame* m_nextSibling; |
479 WebFrame* m_firstChild; | 476 WebFrame* m_firstChild; |
480 WebFrame* m_lastChild; | 477 WebFrame* m_lastChild; |
481 | 478 |
482 WebFrame* m_opener; | 479 WebFrame* m_opener; |
483 std::unique_ptr<OpenedFrameTracker> m_openedFrameTracker; | 480 std::unique_ptr<OpenedFrameTracker> m_openedFrameTracker; |
484 }; | 481 }; |
485 | 482 |
486 } // namespace blink | 483 } // namespace blink |
487 | 484 |
488 #endif | 485 #endif |
OLD | NEW |