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

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

Issue 1132133009: Plumb whether or not a frame is in shadow DOM to the embedder. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/WebViewTest.cpp ('k') | public/web/WebFrameClient.h » ('j') | 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 24 matching lines...) Expand all
35 #include "WebHistoryItem.h" 35 #include "WebHistoryItem.h"
36 #include "WebIconURL.h" 36 #include "WebIconURL.h"
37 #include "WebNode.h" 37 #include "WebNode.h"
38 #include "WebURLLoaderOptions.h" 38 #include "WebURLLoaderOptions.h"
39 #include "public/platform/WebCanvas.h" 39 #include "public/platform/WebCanvas.h"
40 #include "public/platform/WebMessagePortChannel.h" 40 #include "public/platform/WebMessagePortChannel.h"
41 #include "public/platform/WebPrivateOwnPtr.h" 41 #include "public/platform/WebPrivateOwnPtr.h"
42 #include "public/platform/WebReferrerPolicy.h" 42 #include "public/platform/WebReferrerPolicy.h"
43 #include "public/platform/WebURL.h" 43 #include "public/platform/WebURL.h"
44 #include "public/platform/WebURLRequest.h" 44 #include "public/platform/WebURLRequest.h"
45 #include "public/web/WebTreeScopeType.h"
45 46
46 struct NPObject; 47 struct NPObject;
47 48
48 namespace v8 { 49 namespace v8 {
49 class Context; 50 class Context;
50 class Function; 51 class Function;
51 class Object; 52 class Object;
52 class Value; 53 class Value;
53 template <class T> class Local; 54 template <class T> class Local;
54 } 55 }
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 // Only for testing purpose: 671 // Only for testing purpose:
671 // Returns true if selection.anchorNode has a marker on range from |from| wi th |length|. 672 // Returns true if selection.anchorNode has a marker on range from |from| wi th |length|.
672 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0; 673 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0;
673 674
674 // Dumps the layer tree, used by the accelerated compositor, in 675 // Dumps the layer tree, used by the accelerated compositor, in
675 // text form. This is used only by layout tests. 676 // text form. This is used only by layout tests.
676 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; 677 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0;
677 678
678 #if BLINK_IMPLEMENTATION 679 #if BLINK_IMPLEMENTATION
679 static WebFrame* fromFrame(Frame*); 680 static WebFrame* fromFrame(Frame*);
681
682 bool inShadowTree() const { return m_scope == WebTreeScopeType::Shadow; }
683
680 #if ENABLE(OILPAN) 684 #if ENABLE(OILPAN)
681 static void traceFrames(Visitor*, WebFrame*); 685 static void traceFrames(Visitor*, WebFrame*);
682 static void traceFrames(InlinedGlobalMarkingVisitor, WebFrame*); 686 static void traceFrames(InlinedGlobalMarkingVisitor, WebFrame*);
683 void clearWeakFrames(Visitor*); 687 void clearWeakFrames(Visitor*);
684 void clearWeakFrames(InlinedGlobalMarkingVisitor); 688 void clearWeakFrames(InlinedGlobalMarkingVisitor);
685 #endif 689 #endif
686 #endif 690 #endif
687 691
688 protected: 692 protected:
689 WebFrame(); 693 explicit WebFrame(WebTreeScopeType);
690 virtual ~WebFrame(); 694 virtual ~WebFrame();
691 695
692 // Sets the parent WITHOUT fulling adding it to the frame tree. 696 // Sets the parent WITHOUT fulling adding it to the frame tree.
693 // Used to lie to a local frame that is replacing a remote frame, 697 // Used to lie to a local frame that is replacing a remote frame,
694 // so it can properly start a navigation but wait to swap until 698 // so it can properly start a navigation but wait to swap until
695 // commit-time. 699 // commit-time.
696 void setParent(WebFrame*); 700 void setParent(WebFrame*);
697 701
698 private: 702 private:
699 friend class OpenedFrameTracker; 703 friend class OpenedFrameTracker;
700 704
701 #if BLINK_IMPLEMENTATION 705 #if BLINK_IMPLEMENTATION
702 #if ENABLE(OILPAN) 706 #if ENABLE(OILPAN)
703 static void traceFrame(Visitor*, WebFrame*); 707 static void traceFrame(Visitor*, WebFrame*);
704 static void traceFrame(InlinedGlobalMarkingVisitor, WebFrame*); 708 static void traceFrame(InlinedGlobalMarkingVisitor, WebFrame*);
705 static bool isFrameAlive(Visitor*, const WebFrame*); 709 static bool isFrameAlive(Visitor*, const WebFrame*);
706 static bool isFrameAlive(InlinedGlobalMarkingVisitor, const WebFrame*); 710 static bool isFrameAlive(InlinedGlobalMarkingVisitor, const WebFrame*);
707 711
708 template <typename VisitorDispatcher> 712 template <typename VisitorDispatcher>
709 static void traceFramesImpl(VisitorDispatcher, WebFrame*); 713 static void traceFramesImpl(VisitorDispatcher, WebFrame*);
710 template <typename VisitorDispatcher> 714 template <typename VisitorDispatcher>
711 void clearWeakFramesImpl(VisitorDispatcher); 715 void clearWeakFramesImpl(VisitorDispatcher);
712 template <typename VisitorDispatcher> 716 template <typename VisitorDispatcher>
713 static void traceFrameImpl(VisitorDispatcher, WebFrame*); 717 static void traceFrameImpl(VisitorDispatcher, WebFrame*);
714 template <typename VisitorDispatcher> 718 template <typename VisitorDispatcher>
715 static bool isFrameAliveImpl(VisitorDispatcher, const WebFrame*); 719 static bool isFrameAliveImpl(VisitorDispatcher, const WebFrame*);
716 #endif 720 #endif
717 #endif 721 #endif
718 722
723 const WebTreeScopeType m_scope;
724
719 WebFrame* m_parent; 725 WebFrame* m_parent;
720 WebFrame* m_previousSibling; 726 WebFrame* m_previousSibling;
721 WebFrame* m_nextSibling; 727 WebFrame* m_nextSibling;
722 WebFrame* m_firstChild; 728 WebFrame* m_firstChild;
723 WebFrame* m_lastChild; 729 WebFrame* m_lastChild;
724 730
725 WebFrame* m_opener; 731 WebFrame* m_opener;
726 WebPrivateOwnPtr<OpenedFrameTracker> m_openedFrameTracker; 732 WebPrivateOwnPtr<OpenedFrameTracker> m_openedFrameTracker;
727 }; 733 };
728 734
729 #if BLINK_IMPLEMENTATION 735 #if BLINK_IMPLEMENTATION
730 Frame* toCoreFrame(const WebFrame*); 736 Frame* toCoreFrame(const WebFrame*);
731 #endif 737 #endif
732 738
733 } // namespace blink 739 } // namespace blink
734 740
735 #endif 741 #endif
OLDNEW
« no previous file with comments | « Source/web/tests/WebViewTest.cpp ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698