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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 PinchViewport& pinchViewport() const; | 78 PinchViewport& pinchViewport() const; |
79 EventHandlerRegistry& eventHandlerRegistry() const; | 79 EventHandlerRegistry& eventHandlerRegistry() const; |
80 | 80 |
81 const AtomicString& overrideEncoding() const { return m_overrideEncoding; } | 81 const AtomicString& overrideEncoding() const { return m_overrideEncoding; } |
82 void setOverrideEncoding(const AtomicString& encoding) { m_overrideEncoding
= encoding; } | 82 void setOverrideEncoding(const AtomicString& encoding) { m_overrideEncoding
= encoding; } |
83 | 83 |
84 ConsoleMessageStorage& consoleMessageStorage() const; | 84 ConsoleMessageStorage& consoleMessageStorage() const; |
85 | 85 |
86 void trace(Visitor*); | 86 void trace(Visitor*); |
87 | 87 |
| 88 // Don't allow more than a certain number of frames in a page. |
| 89 // This seems like a reasonable upper bound, and otherwise mutually |
| 90 // recursive frameset pages can quickly bring the program to its knees |
| 91 // with exponential growth in the number of frames. |
| 92 static const int maxNumberOfFrames = 1000; |
| 93 void incrementSubframeCount() { ++m_subframeCount; } |
| 94 void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount;
} |
| 95 int subframeCount() const; |
| 96 |
88 private: | 97 private: |
89 explicit FrameHost(Page&); | 98 explicit FrameHost(Page&); |
90 | 99 |
91 RawPtrWillBeMember<Page> m_page; | 100 RawPtrWillBeMember<Page> m_page; |
92 const OwnPtrWillBeMember<PinchViewport> m_pinchViewport; | 101 const OwnPtrWillBeMember<PinchViewport> m_pinchViewport; |
93 const OwnPtrWillBeMember<EventHandlerRegistry> m_eventHandlerRegistry; | 102 const OwnPtrWillBeMember<EventHandlerRegistry> m_eventHandlerRegistry; |
94 const OwnPtrWillBeMember<ConsoleMessageStorage> m_consoleMessageStorage; | 103 const OwnPtrWillBeMember<ConsoleMessageStorage> m_consoleMessageStorage; |
95 | 104 |
96 AtomicString m_overrideEncoding; | 105 AtomicString m_overrideEncoding; |
| 106 int m_subframeCount; |
97 }; | 107 }; |
98 | 108 |
99 } | 109 } |
100 | 110 |
101 #endif // FrameHost_h | 111 #endif // FrameHost_h |
OLD | NEW |