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 23 matching lines...) Expand all Loading... |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
36 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
37 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
38 #include "wtf/text/AtomicString.h" | 38 #include "wtf/text/AtomicString.h" |
39 #include <memory> | 39 #include <memory> |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class BrowserControls; | 43 class BrowserControls; |
44 class ConsoleMessageStorage; | |
45 class OverscrollController; | 44 class OverscrollController; |
46 class Page; | 45 class Page; |
47 | 46 |
48 // FrameHost is the set of global data shared between multiple frames | 47 // FrameHost is the set of global data shared between multiple frames |
49 // and is provided by the embedder to each frame when created. | 48 // and is provided by the embedder to each frame when created. |
50 // FrameHost currently corresponds to the Page object in core/page | 49 // FrameHost currently corresponds to the Page object in core/page |
51 // however the concept of a Page is moving up out of Blink. | 50 // however the concept of a Page is moving up out of Blink. |
52 // In an out-of-process iframe world, a single Page may have | 51 // In an out-of-process iframe world, a single Page may have |
53 // multiple frames in different process, thus Page becomes a | 52 // multiple frames in different process, thus Page becomes a |
54 // browser-level concept and Blink core/ only knows about its LocalFrame (and | 53 // browser-level concept and Blink core/ only knows about its LocalFrame (and |
(...skipping 10 matching lines...) Expand all Loading... |
65 | 64 |
66 Page& page(); | 65 Page& page(); |
67 const Page& page() const; | 66 const Page& page() const; |
68 | 67 |
69 BrowserControls& browserControls(); | 68 BrowserControls& browserControls(); |
70 const BrowserControls& browserControls() const; | 69 const BrowserControls& browserControls() const; |
71 | 70 |
72 OverscrollController& overscrollController(); | 71 OverscrollController& overscrollController(); |
73 const OverscrollController& overscrollController() const; | 72 const OverscrollController& overscrollController() const; |
74 | 73 |
75 ConsoleMessageStorage& consoleMessageStorage(); | |
76 const ConsoleMessageStorage& consoleMessageStorage() const; | |
77 | |
78 DECLARE_TRACE(); | 74 DECLARE_TRACE(); |
79 | 75 |
80 // Don't allow more than a certain number of frames in a page. | 76 // Don't allow more than a certain number of frames in a page. |
81 // This seems like a reasonable upper bound, and otherwise mutually | 77 // This seems like a reasonable upper bound, and otherwise mutually |
82 // recursive frameset pages can quickly bring the program to its knees | 78 // recursive frameset pages can quickly bring the program to its knees |
83 // with exponential growth in the number of frames. | 79 // with exponential growth in the number of frames. |
84 static const int maxNumberOfFrames = 1000; | 80 static const int maxNumberOfFrames = 1000; |
85 void incrementSubframeCount() { ++m_subframeCount; } | 81 void incrementSubframeCount() { ++m_subframeCount; } |
86 void decrementSubframeCount() { | 82 void decrementSubframeCount() { |
87 ASSERT(m_subframeCount); | 83 ASSERT(m_subframeCount); |
88 --m_subframeCount; | 84 --m_subframeCount; |
89 } | 85 } |
90 int subframeCount() const; | 86 int subframeCount() const; |
91 | 87 |
92 private: | 88 private: |
93 explicit FrameHost(Page&); | 89 explicit FrameHost(Page&); |
94 | 90 |
95 const Member<Page> m_page; | 91 const Member<Page> m_page; |
96 | 92 |
97 int m_subframeCount; | 93 int m_subframeCount; |
98 }; | 94 }; |
99 | 95 |
100 } // namespace blink | 96 } // namespace blink |
101 | 97 |
102 #endif // FrameHost_h | 98 #endif // FrameHost_h |
OLD | NEW |