OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 EventHandlerRegistry& eventHandlerRegistry(); | 81 EventHandlerRegistry& eventHandlerRegistry(); |
82 const EventHandlerRegistry& eventHandlerRegistry() const; | 82 const EventHandlerRegistry& eventHandlerRegistry() const; |
83 | 83 |
84 ConsoleMessageStorage& consoleMessageStorage(); | 84 ConsoleMessageStorage& consoleMessageStorage(); |
85 const ConsoleMessageStorage& consoleMessageStorage() const; | 85 const ConsoleMessageStorage& consoleMessageStorage() const; |
86 | 86 |
87 TopDocumentRootScrollerController& globalRootScrollerController() const; | 87 TopDocumentRootScrollerController& globalRootScrollerController() const; |
88 | 88 |
89 DECLARE_TRACE(); | 89 DECLARE_TRACE(); |
90 | 90 |
91 // Don't allow more than a certain number of frames in a page. | 91 void incrementSubframeCount(); |
92 // This seems like a reasonable upper bound, and otherwise mutually | 92 void decrementSubframeCount(); |
93 // recursive frameset pages can quickly bring the program to its knees | |
94 // with exponential growth in the number of frames. | |
95 static const int maxNumberOfFrames = 1000; | |
96 void incrementSubframeCount() { ++m_subframeCount; } | |
97 void decrementSubframeCount() { | |
98 ASSERT(m_subframeCount); | |
99 --m_subframeCount; | |
100 } | |
101 int subframeCount() const; | 93 int subframeCount() const; |
102 | 94 |
103 private: | 95 private: |
104 explicit FrameHost(Page&); | 96 explicit FrameHost(Page&); |
105 | 97 |
106 const Member<Page> m_page; | 98 const Member<Page> m_page; |
107 const Member<VisualViewport> m_visualViewport; | 99 const Member<VisualViewport> m_visualViewport; |
108 const Member<OverscrollController> m_overscrollController; | 100 const Member<OverscrollController> m_overscrollController; |
109 const Member<EventHandlerRegistry> m_eventHandlerRegistry; | 101 const Member<EventHandlerRegistry> m_eventHandlerRegistry; |
110 const Member<ConsoleMessageStorage> m_consoleMessageStorage; | 102 const Member<ConsoleMessageStorage> m_consoleMessageStorage; |
111 const Member<TopDocumentRootScrollerController> | 103 const Member<TopDocumentRootScrollerController> |
112 m_globalRootScrollerController; | 104 m_globalRootScrollerController; |
113 | 105 |
114 AtomicString m_overrideEncoding; | 106 AtomicString m_overrideEncoding; |
115 int m_subframeCount; | |
116 }; | 107 }; |
117 | 108 |
118 } // namespace blink | 109 } // namespace blink |
119 | 110 |
120 #endif // FrameHost_h | 111 #endif // FrameHost_h |
OLD | NEW |