| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "core/frame/FrameHost.h" | 31 #include "core/frame/FrameHost.h" |
| 32 | 32 |
| 33 #include "core/dom/custom/CustomElementReactionStack.h" | 33 #include "core/dom/custom/CustomElementReactionStack.h" |
| 34 #include "core/frame/EventHandlerRegistry.h" | 34 #include "core/frame/EventHandlerRegistry.h" |
| 35 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
| 36 #include "core/frame/PageScaleConstraints.h" | 36 #include "core/frame/PageScaleConstraints.h" |
| 37 #include "core/frame/PageScaleConstraintsSet.h" | 37 #include "core/frame/PageScaleConstraintsSet.h" |
| 38 #include "core/frame/TopControls.h" | 38 #include "core/frame/TopControls.h" |
| 39 #include "core/frame/VisualViewport.h" | 39 #include "core/frame/VisualViewport.h" |
| 40 #include "core/inspector/ConsoleMessageStorage.h" |
| 40 #include "core/page/Page.h" | 41 #include "core/page/Page.h" |
| 41 #include "core/page/scrolling/OverscrollController.h" | 42 #include "core/page/scrolling/OverscrollController.h" |
| 42 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
| 43 #include "public/platform/WebScheduler.h" | 44 #include "public/platform/WebScheduler.h" |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| 47 FrameHost* FrameHost::create(Page& page) | 48 FrameHost* FrameHost::create(Page& page) |
| 48 { | 49 { |
| 49 return new FrameHost(page); | 50 return new FrameHost(page); |
| 50 } | 51 } |
| 51 | 52 |
| 52 FrameHost::FrameHost(Page& page) | 53 FrameHost::FrameHost(Page& page) |
| 53 : m_page(&page) | 54 : m_page(&page) |
| 54 , m_topControls(TopControls::create(*this)) | 55 , m_topControls(TopControls::create(*this)) |
| 55 , m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()) | 56 , m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()) |
| 56 , m_visualViewport(VisualViewport::create(*this)) | 57 , m_visualViewport(VisualViewport::create(*this)) |
| 57 , m_overscrollController(OverscrollController::create( | 58 , m_overscrollController(OverscrollController::create( |
| 58 *m_visualViewport, | 59 *m_visualViewport, |
| 59 m_page->chromeClient())) | 60 m_page->chromeClient())) |
| 60 , m_eventHandlerRegistry(new EventHandlerRegistry(*this)) | 61 , m_eventHandlerRegistry(new EventHandlerRegistry(*this)) |
| 62 , m_consoleMessageStorage(new ConsoleMessageStorage()) |
| 61 , m_customElementReactionStack(new CustomElementReactionStack()) | 63 , m_customElementReactionStack(new CustomElementReactionStack()) |
| 62 , m_subframeCount(0) | 64 , m_subframeCount(0) |
| 63 { | 65 { |
| 64 } | 66 } |
| 65 | 67 |
| 66 // Explicitly in the .cpp to avoid default constructor in .h | 68 // Explicitly in the .cpp to avoid default constructor in .h |
| 67 FrameHost::~FrameHost() | 69 FrameHost::~FrameHost() |
| 68 { | 70 { |
| 69 } | 71 } |
| 70 | 72 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 EventHandlerRegistry& FrameHost::eventHandlerRegistry() | 168 EventHandlerRegistry& FrameHost::eventHandlerRegistry() |
| 167 { | 169 { |
| 168 return *m_eventHandlerRegistry; | 170 return *m_eventHandlerRegistry; |
| 169 } | 171 } |
| 170 | 172 |
| 171 const EventHandlerRegistry& FrameHost::eventHandlerRegistry() const | 173 const EventHandlerRegistry& FrameHost::eventHandlerRegistry() const |
| 172 { | 174 { |
| 173 return *m_eventHandlerRegistry; | 175 return *m_eventHandlerRegistry; |
| 174 } | 176 } |
| 175 | 177 |
| 178 ConsoleMessageStorage& FrameHost::consoleMessageStorage() |
| 179 { |
| 180 return *m_consoleMessageStorage; |
| 181 } |
| 182 |
| 183 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const |
| 184 { |
| 185 return *m_consoleMessageStorage; |
| 186 } |
| 187 |
| 176 CustomElementReactionStack& FrameHost::customElementReactionStack() | 188 CustomElementReactionStack& FrameHost::customElementReactionStack() |
| 177 { | 189 { |
| 178 return *m_customElementReactionStack; | 190 return *m_customElementReactionStack; |
| 179 } | 191 } |
| 180 | 192 |
| 181 const CustomElementReactionStack& FrameHost::customElementReactionStack() const | 193 const CustomElementReactionStack& FrameHost::customElementReactionStack() const |
| 182 { | 194 { |
| 183 return *m_customElementReactionStack; | 195 return *m_customElementReactionStack; |
| 184 } | 196 } |
| 185 | 197 |
| 186 DEFINE_TRACE(FrameHost) | 198 DEFINE_TRACE(FrameHost) |
| 187 { | 199 { |
| 188 visitor->trace(m_page); | 200 visitor->trace(m_page); |
| 189 visitor->trace(m_topControls); | 201 visitor->trace(m_topControls); |
| 190 visitor->trace(m_visualViewport); | 202 visitor->trace(m_visualViewport); |
| 191 visitor->trace(m_overscrollController); | 203 visitor->trace(m_overscrollController); |
| 192 visitor->trace(m_eventHandlerRegistry); | 204 visitor->trace(m_eventHandlerRegistry); |
| 205 visitor->trace(m_consoleMessageStorage); |
| 193 visitor->trace(m_customElementReactionStack); | 206 visitor->trace(m_customElementReactionStack); |
| 194 } | 207 } |
| 195 | 208 |
| 196 #if ENABLE(ASSERT) | 209 #if ENABLE(ASSERT) |
| 197 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) | 210 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) |
| 198 { | 211 { |
| 199 ASSERT(expectedFrameCount >= 0); | 212 ASSERT(expectedFrameCount >= 0); |
| 200 | 213 |
| 201 int actualFrameCount = 0; | 214 int actualFrameCount = 0; |
| 202 for (; frame; frame = frame->tree().traverseNext()) | 215 for (; frame; frame = frame->tree().traverseNext()) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 263 |
| 251 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); | 264 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); |
| 252 | 265 |
| 253 if (!rootView) | 266 if (!rootView) |
| 254 return; | 267 return; |
| 255 | 268 |
| 256 rootView->setNeedsLayout(); | 269 rootView->setNeedsLayout(); |
| 257 } | 270 } |
| 258 | 271 |
| 259 } // namespace blink | 272 } // namespace blink |
| OLD | NEW |