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

Side by Side Diff: Source/web/WebFrameWidgetImpl.cpp

Issue 1294293004: Oilpan: Move WebFrameWidgetImpl into Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebFrameWidgetImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 WebFrameWidget* WebFrameWidget::create(WebView* webView) 68 WebFrameWidget* WebFrameWidget::create(WebView* webView)
69 { 69 {
70 return new WebViewFrameWidget(*toWebViewImpl(webView)); 70 return new WebViewFrameWidget(*toWebViewImpl(webView));
71 } 71 }
72 72
73 WebFrameWidgetImpl* WebFrameWidgetImpl::create(WebWidgetClient* client, WebLocal Frame* localRoot) 73 WebFrameWidgetImpl* WebFrameWidgetImpl::create(WebWidgetClient* client, WebLocal Frame* localRoot)
74 { 74 {
75 // Pass the WebFrameWidgetImpl's self-reference to the caller. 75 // Pass the WebFrameWidgetImpl's self-reference to the caller.
76 #if ENABLE(OILPAN)
77 return new WebFrameWidgetImpl(client, localRoot); // SelfKeepAlive is set in constructor.
78 #else
76 return adoptRef(new WebFrameWidgetImpl(client, localRoot)).leakRef(); 79 return adoptRef(new WebFrameWidgetImpl(client, localRoot)).leakRef();
80 #endif
77 } 81 }
78 82
79 // static 83 // static
80 HashSet<WebFrameWidgetImpl*>& WebFrameWidgetImpl::allInstances() 84 HashSet<WebFrameWidgetImpl*>& WebFrameWidgetImpl::allInstances()
81 { 85 {
82 DEFINE_STATIC_LOCAL(HashSet<WebFrameWidgetImpl*>, allInstances, ()); 86 DEFINE_STATIC_LOCAL(HashSet<WebFrameWidgetImpl*>, allInstances, ());
83 return allInstances; 87 return allInstances;
84 } 88 }
85 89
86 WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, WebLocalFrame* l ocalRoot) 90 WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, WebLocalFrame* l ocalRoot)
87 : m_client(client) 91 : m_client(client)
88 , m_localRoot(toWebLocalFrameImpl(localRoot)) 92 , m_localRoot(toWebLocalFrameImpl(localRoot))
89 , m_layerTreeView(nullptr) 93 , m_layerTreeView(nullptr)
90 , m_rootLayer(nullptr) 94 , m_rootLayer(nullptr)
91 , m_rootGraphicsLayer(nullptr) 95 , m_rootGraphicsLayer(nullptr)
92 , m_isAcceleratedCompositingActive(false) 96 , m_isAcceleratedCompositingActive(false)
93 , m_layerTreeViewClosed(false) 97 , m_layerTreeViewClosed(false)
94 , m_suppressNextKeypressEvent(false) 98 , m_suppressNextKeypressEvent(false)
95 , m_ignoreInputEvents(false) 99 , m_ignoreInputEvents(false)
100 #if ENABLE(OILPAN)
101 , m_selfKeepAlive(this)
102 #endif
96 { 103 {
97 ASSERT(m_localRoot->frame()->isLocalRoot()); 104 ASSERT(m_localRoot->frame()->isLocalRoot());
98 initializeLayerTreeView(); 105 initializeLayerTreeView();
99 m_localRoot->setFrameWidget(this); 106 m_localRoot->setFrameWidget(this);
100 allInstances().add(this); 107 allInstances().add(this);
101 } 108 }
102 109
103 WebFrameWidgetImpl::~WebFrameWidgetImpl() 110 WebFrameWidgetImpl::~WebFrameWidgetImpl()
104 { 111 {
105 } 112 }
106 113
114 DEFINE_TRACE(WebFrameWidgetImpl)
115 {
116 visitor->trace(m_localRoot);
117 visitor->trace(m_mouseCaptureNode);
118 }
119
107 // WebWidget ------------------------------------------------------------------ 120 // WebWidget ------------------------------------------------------------------
108 121
109 void WebFrameWidgetImpl::close() 122 void WebFrameWidgetImpl::close()
110 { 123 {
111 WebDevToolsAgentImpl::webFrameWidgetImplClosed(this); 124 WebDevToolsAgentImpl::webFrameWidgetImplClosed(this);
112 ASSERT(allInstances().contains(this)); 125 ASSERT(allInstances().contains(this));
113 allInstances().remove(this); 126 allInstances().remove(this);
114 127
115 m_localRoot->setFrameWidget(nullptr); 128 m_localRoot->setFrameWidget(nullptr);
116 m_localRoot = nullptr; 129 m_localRoot = nullptr;
117 // Reset the delegate to prevent notifications being sent as we're being 130 // Reset the delegate to prevent notifications being sent as we're being
118 // deleted. 131 // deleted.
119 m_client = nullptr; 132 m_client = nullptr;
haraken 2015/08/18 08:03:08 Can we clear m_layerTreeView, m_rootLayer, m_rootG
Yuta Kitamura 2015/08/18 08:33:59 Done.
120 133
134 #if ENABLE(OILPAN)
135 m_selfKeepAlive.clear();
136 #else
121 deref(); // Balances ref() acquired in WebFrameWidget::create 137 deref(); // Balances ref() acquired in WebFrameWidget::create
138 #endif
122 } 139 }
123 140
124 WebSize WebFrameWidgetImpl::size() 141 WebSize WebFrameWidgetImpl::size()
125 { 142 {
126 return m_size; 143 return m_size;
127 } 144 }
128 145
129 void WebFrameWidgetImpl::willStartLiveResize() 146 void WebFrameWidgetImpl::willStartLiveResize()
130 { 147 {
131 if (m_localRoot->frameView()) 148 if (m_localRoot->frameView())
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility. 1046 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility.
1030 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState); 1047 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState);
1031 1048
1032 if (m_layerTreeView) { 1049 if (m_layerTreeView) {
1033 bool visible = visibilityState == WebPageVisibilityStateVisible; 1050 bool visible = visibilityState == WebPageVisibilityStateVisible;
1034 m_layerTreeView->setVisible(visible); 1051 m_layerTreeView->setVisible(visible);
1035 } 1052 }
1036 } 1053 }
1037 1054
1038 } // namespace blink 1055 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebFrameWidgetImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698