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