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

Side by Side Diff: third_party/WebKit/Source/web/ExternalPopupMenu.cpp

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 void ExternalPopupMenu::updateFromElement() 145 void ExternalPopupMenu::updateFromElement()
146 { 146 {
147 if (m_needsUpdate) 147 if (m_needsUpdate)
148 return; 148 return;
149 // TOOD(tkent): Even if DOMTreeVersion is not changed, we should update the 149 // TOOD(tkent): Even if DOMTreeVersion is not changed, we should update the
150 // popup location/content in some cases. e.g. Updating ComputedStyle of the 150 // popup location/content in some cases. e.g. Updating ComputedStyle of the
151 // SELECT element affects popup position and OPTION style. 151 // SELECT element affects popup position and OPTION style.
152 if (m_shownDOMTreeVersion == m_ownerElement->document().domTreeVersion()) 152 if (m_shownDOMTreeVersion == m_ownerElement->document().domTreeVersion())
153 return; 153 return;
154 m_needsUpdate = true; 154 m_needsUpdate = true;
155 m_ownerElement->document().postTask(BLINK_FROM_HERE, createSameThreadTask(&E xternalPopupMenu::update, this)); 155 m_ownerElement->document().postTask(BLINK_FROM_HERE, createSameThreadTask(&E xternalPopupMenu::update, retainedRef(this)));
156 } 156 }
157 157
158 void ExternalPopupMenu::update() 158 void ExternalPopupMenu::update()
159 { 159 {
160 if (!m_webExternalPopupMenu || !m_ownerElement) 160 if (!m_webExternalPopupMenu || !m_ownerElement)
161 return; 161 return;
162 m_ownerElement->document().updateLayoutTree(); 162 m_ownerElement->document().updateLayoutTree();
163 // disconnectClient() might have been called. 163 // disconnectClient() might have been called.
164 if (!m_ownerElement) 164 if (!m_ownerElement)
165 return; 165 return;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 if (ownerElement.itemIsDisplayNone(*items[i])) 290 if (ownerElement.itemIsDisplayNone(*items[i]))
291 continue; 291 continue;
292 if (popupMenuItemIndex == i) 292 if (popupMenuItemIndex == i)
293 return indexTracker; 293 return indexTracker;
294 ++indexTracker; 294 ++indexTracker;
295 } 295 }
296 return -1; 296 return -1;
297 } 297 }
298 298
299 } // namespace blink 299 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | third_party/WebKit/Source/web/PopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698