Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameHost.cpp

Issue 2738703003: Move FrameHost::m_consoleMessageStorage to Page (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 #include "core/frame/FrameHost.h" 31 #include "core/frame/FrameHost.h"
32 32
33 #include "core/frame/FrameView.h" 33 #include "core/frame/FrameView.h"
34 #include "core/inspector/ConsoleMessageStorage.h"
35 #include "core/page/Page.h" 34 #include "core/page/Page.h"
36 #include "core/page/scrolling/OverscrollController.h" 35 #include "core/page/scrolling/OverscrollController.h"
37 #include "public/platform/Platform.h" 36 #include "public/platform/Platform.h"
38 #include "public/platform/WebScheduler.h" 37 #include "public/platform/WebScheduler.h"
39 38
40 namespace blink { 39 namespace blink {
41 40
42 FrameHost* FrameHost::create(Page& page) { 41 FrameHost* FrameHost::create(Page& page) {
43 return new FrameHost(page); 42 return new FrameHost(page);
44 } 43 }
45 44
46 FrameHost::FrameHost(Page& page) 45 FrameHost::FrameHost(Page& page)
47 : m_page(&page), 46 : m_page(&page),
48 m_overscrollController( 47 m_overscrollController(
49 OverscrollController::create(m_page->visualViewport(), 48 OverscrollController::create(m_page->visualViewport(),
50 m_page->chromeClient())), 49 m_page->chromeClient())),
51 m_consoleMessageStorage(new ConsoleMessageStorage()),
52 m_subframeCount(0) {} 50 m_subframeCount(0) {}
53 51
54 // Explicitly in the .cpp to avoid default constructor in .h 52 // Explicitly in the .cpp to avoid default constructor in .h
55 FrameHost::~FrameHost() {} 53 FrameHost::~FrameHost() {}
56 54
57 Page& FrameHost::page() { 55 Page& FrameHost::page() {
58 return *m_page; 56 return *m_page;
59 } 57 }
60 58
61 const Page& FrameHost::page() const { 59 const Page& FrameHost::page() const {
(...skipping 10 matching lines...) Expand all
72 70
73 OverscrollController& FrameHost::overscrollController() { 71 OverscrollController& FrameHost::overscrollController() {
74 return *m_overscrollController; 72 return *m_overscrollController;
75 } 73 }
76 74
77 const OverscrollController& FrameHost::overscrollController() const { 75 const OverscrollController& FrameHost::overscrollController() const {
78 return *m_overscrollController; 76 return *m_overscrollController;
79 } 77 }
80 78
81 ConsoleMessageStorage& FrameHost::consoleMessageStorage() { 79 ConsoleMessageStorage& FrameHost::consoleMessageStorage() {
82 return *m_consoleMessageStorage; 80 return page().consoleMessageStorage();
83 } 81 }
84 82
85 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const { 83 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const {
86 return *m_consoleMessageStorage; 84 return page().consoleMessageStorage();
87 } 85 }
88 86
89 DEFINE_TRACE(FrameHost) { 87 DEFINE_TRACE(FrameHost) {
90 visitor->trace(m_page); 88 visitor->trace(m_page);
91 visitor->trace(m_overscrollController); 89 visitor->trace(m_overscrollController);
92 visitor->trace(m_consoleMessageStorage);
93 } 90 }
94 91
95 #if DCHECK_IS_ON() 92 #if DCHECK_IS_ON()
96 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { 93 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) {
97 ASSERT(expectedFrameCount >= 0); 94 ASSERT(expectedFrameCount >= 0);
98 95
99 int actualFrameCount = 0; 96 int actualFrameCount = 0;
100 for (; frame; frame = frame->tree().traverseNext()) 97 for (; frame; frame = frame->tree().traverseNext())
101 ++actualFrameCount; 98 ++actualFrameCount;
102 99
103 ASSERT(expectedFrameCount == actualFrameCount); 100 ASSERT(expectedFrameCount == actualFrameCount);
104 } 101 }
105 #endif 102 #endif
106 103
107 int FrameHost::subframeCount() const { 104 int FrameHost::subframeCount() const {
108 #if DCHECK_IS_ON() 105 #if DCHECK_IS_ON()
109 checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame()); 106 checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame());
110 #endif 107 #endif
111 return m_subframeCount; 108 return m_subframeCount;
112 } 109 }
113 110
114 } // namespace blink 111 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameHost.h ('k') | third_party/WebKit/Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698