| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FrameHost_h | 31 #ifndef FrameHost_h |
| 32 #define FrameHost_h | 32 #define FrameHost_h |
| 33 | 33 |
| 34 #include "core/frame/PinchViewport.h" | 34 #include "core/frame/PinchViewport.h" |
| 35 #include "core/frame/TopControls.h" |
| 35 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
| 36 #include "wtf/FastAllocBase.h" | 37 #include "wtf/FastAllocBase.h" |
| 37 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
| 38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
| 39 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class Chrome; | 44 class Chrome; |
| 44 class ConsoleMessageStorage; | 45 class ConsoleMessageStorage; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 70 Settings& settings() const; | 71 Settings& settings() const; |
| 71 Chrome& chrome() const; | 72 Chrome& chrome() const; |
| 72 UseCounter& useCounter() const; | 73 UseCounter& useCounter() const; |
| 73 InstrumentingAgents* instrumentingAgents() const; | 74 InstrumentingAgents* instrumentingAgents() const; |
| 74 | 75 |
| 75 // Corresponds to pixel density of the device where this Page is | 76 // Corresponds to pixel density of the device where this Page is |
| 76 // being displayed. In multi-monitor setups this can vary between pages. | 77 // being displayed. In multi-monitor setups this can vary between pages. |
| 77 // This value does not account for Page zoom, use LocalFrame::devicePixelRat
io instead. | 78 // This value does not account for Page zoom, use LocalFrame::devicePixelRat
io instead. |
| 78 float deviceScaleFactor() const; | 79 float deviceScaleFactor() const; |
| 79 | 80 |
| 81 TopControls& topControls() const; |
| 80 PinchViewport& pinchViewport() const; | 82 PinchViewport& pinchViewport() const; |
| 81 EventHandlerRegistry& eventHandlerRegistry() const; | 83 EventHandlerRegistry& eventHandlerRegistry() const; |
| 82 | 84 |
| 83 const AtomicString& overrideEncoding() const { return m_overrideEncoding; } | 85 const AtomicString& overrideEncoding() const { return m_overrideEncoding; } |
| 84 void setOverrideEncoding(const AtomicString& encoding) { m_overrideEncoding
= encoding; } | 86 void setOverrideEncoding(const AtomicString& encoding) { m_overrideEncoding
= encoding; } |
| 85 | 87 |
| 86 ConsoleMessageStorage& consoleMessageStorage() const; | 88 ConsoleMessageStorage& consoleMessageStorage() const; |
| 87 | 89 |
| 88 void trace(Visitor*); | 90 void trace(Visitor*); |
| 89 | 91 |
| 90 // Don't allow more than a certain number of frames in a page. | 92 // Don't allow more than a certain number of frames in a page. |
| 91 // This seems like a reasonable upper bound, and otherwise mutually | 93 // This seems like a reasonable upper bound, and otherwise mutually |
| 92 // recursive frameset pages can quickly bring the program to its knees | 94 // recursive frameset pages can quickly bring the program to its knees |
| 93 // with exponential growth in the number of frames. | 95 // with exponential growth in the number of frames. |
| 94 static const int maxNumberOfFrames = 1000; | 96 static const int maxNumberOfFrames = 1000; |
| 95 void incrementSubframeCount() { ++m_subframeCount; } | 97 void incrementSubframeCount() { ++m_subframeCount; } |
| 96 void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount;
} | 98 void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount;
} |
| 97 int subframeCount() const; | 99 int subframeCount() const; |
| 98 | 100 |
| 99 private: | 101 private: |
| 100 explicit FrameHost(Page&); | 102 explicit FrameHost(Page&); |
| 101 | 103 |
| 102 RawPtrWillBeMember<Page> m_page; | 104 RawPtrWillBeMember<Page> m_page; |
| 105 const OwnPtrWillBeMember<TopControls> m_topControls; |
| 103 const OwnPtrWillBeMember<PinchViewport> m_pinchViewport; | 106 const OwnPtrWillBeMember<PinchViewport> m_pinchViewport; |
| 104 const OwnPtrWillBeMember<EventHandlerRegistry> m_eventHandlerRegistry; | 107 const OwnPtrWillBeMember<EventHandlerRegistry> m_eventHandlerRegistry; |
| 105 const OwnPtrWillBeMember<ConsoleMessageStorage> m_consoleMessageStorage; | 108 const OwnPtrWillBeMember<ConsoleMessageStorage> m_consoleMessageStorage; |
| 106 | 109 |
| 107 AtomicString m_overrideEncoding; | 110 AtomicString m_overrideEncoding; |
| 108 int m_subframeCount; | 111 int m_subframeCount; |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 } | 114 } |
| 112 | 115 |
| 113 #endif // FrameHost_h | 116 #endif // FrameHost_h |
| OLD | NEW |