Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp |
| index 90d7742c2a7a0d82a13e9e5e742135dd53aa0b32..f1a04447e14cbc2449b46984f7bfa7884628affd 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp |
| @@ -35,6 +35,7 @@ |
| #include "core/page/Page.h" |
| #include "core/plugins/PluginView.h" |
| #include "platform/weborigin/SecurityOrigin.h" |
| +#include "wtf/Vector.h" |
| namespace blink { |
| @@ -54,9 +55,10 @@ static FrameViewBaseSet& WidgetsPendingTemporaryRemovalFromParent() { |
| return set; |
| } |
| -static FrameViewBaseSet& WidgetsPendingDispose() { |
| - DEFINE_STATIC_LOCAL(FrameViewBaseSet, set, (new FrameViewBaseSet)); |
| - return set; |
| +using DisposeList = Vector<FrameOrPlugin*>; |
| +static DisposeList& PendingDispose() { |
|
dcheng
2017/04/12 00:06:39
PendingDispose / DisposeList is a bit too generic
joelhockey
2017/04/12 04:33:00
If you suggest a name, I'm happy to change it. Bu
|
| + DEFINE_STATIC_LOCAL(DisposeList, list, ()); |
| + return list; |
| } |
| SubframeLoadingDisabler::SubtreeRootSet& |
| @@ -100,10 +102,10 @@ void HTMLFrameOwnerElement::UpdateSuspendScope:: |
| } |
| { |
| - FrameViewBaseSet set; |
| - WidgetsPendingDispose().Swap(set); |
| - for (const auto& frame_view_base : set) { |
| - frame_view_base->Dispose(); |
| + DisposeList list; |
| + PendingDispose().Swap(list); |
| + for (const auto& frame_or_plugin : list) { |
| + frame_or_plugin->Dispose(); |
| } |
| } |
| } |
| @@ -215,12 +217,12 @@ bool HTMLFrameOwnerElement::IsKeyboardFocusable() const { |
| return content_frame_ && HTMLElement::IsKeyboardFocusable(); |
| } |
| -void HTMLFrameOwnerElement::DisposeWidgetSoon(FrameViewBase* frame_view_base) { |
| +void HTMLFrameOwnerElement::DisposeSoon(FrameOrPlugin* frame_or_plugin) { |
| if (g_update_suspend_count) { |
| - WidgetsPendingDispose().insert(frame_view_base); |
| + PendingDispose().push_back(frame_or_plugin); |
| return; |
| } |
| - frame_view_base->Dispose(); |
| + frame_or_plugin->Dispose(); |
| } |
| void HTMLFrameOwnerElement::FrameOwnerPropertiesChanged() { |