OLD | NEW |
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 Loading... |
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; |
120 | 133 |
| 134 m_layerTreeView = nullptr; |
| 135 m_rootLayer = nullptr; |
| 136 m_rootGraphicsLayer = nullptr; |
| 137 |
| 138 #if ENABLE(OILPAN) |
| 139 m_selfKeepAlive.clear(); |
| 140 #else |
121 deref(); // Balances ref() acquired in WebFrameWidget::create | 141 deref(); // Balances ref() acquired in WebFrameWidget::create |
| 142 #endif |
122 } | 143 } |
123 | 144 |
124 WebSize WebFrameWidgetImpl::size() | 145 WebSize WebFrameWidgetImpl::size() |
125 { | 146 { |
126 return m_size; | 147 return m_size; |
127 } | 148 } |
128 | 149 |
129 void WebFrameWidgetImpl::willStartLiveResize() | 150 void WebFrameWidgetImpl::willStartLiveResize() |
130 { | 151 { |
131 if (m_localRoot->frameView()) | 152 if (m_localRoot->frameView()) |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 // correspond to Page visibility, but is necessary until we properly sort ou
t OOPIF visibility. | 1050 // correspond to Page visibility, but is necessary until we properly sort ou
t OOPIF visibility. |
1030 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState)
, isInitialState); | 1051 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState)
, isInitialState); |
1031 | 1052 |
1032 if (m_layerTreeView) { | 1053 if (m_layerTreeView) { |
1033 bool visible = visibilityState == WebPageVisibilityStateVisible; | 1054 bool visible = visibilityState == WebPageVisibilityStateVisible; |
1034 m_layerTreeView->setVisible(visible); | 1055 m_layerTreeView->setVisible(visible); |
1035 } | 1056 } |
1036 } | 1057 } |
1037 | 1058 |
1038 } // namespace blink | 1059 } // namespace blink |
OLD | NEW |