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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp

Issue 2743653002: Make context initialization order deterministic in WebFrame::swap(). (Closed)
Patch Set: Add comment. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp
index 43350caabe273ee755cb9bfda43f13cfea0302c9..a96d286f31687deeaf88dc932298b25d0dcbc2f4 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp
@@ -57,18 +57,18 @@ void WindowProxyManagerBase::clearForNavigation() {
entry.value->clearForNavigation();
}
-void WindowProxyManagerBase::releaseGlobals(
- HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>& map) {
- map.insert(&m_windowProxy->world(), m_windowProxy->releaseGlobal());
- for (auto& entry : m_isolatedWorlds)
- map.insert(&entry.value->world(),
- windowProxy(entry.value->world())->releaseGlobal());
+void WindowProxyManagerBase::releaseGlobals(GlobalsVector& globals) {
+ globals.reserveInitialCapacity(1 + m_isolatedWorlds.size());
+ globals.emplace_back(&m_windowProxy->world(), m_windowProxy->releaseGlobal());
+ for (auto& entry : m_isolatedWorlds) {
+ globals.emplace_back(&entry.value->world(),
+ windowProxy(entry.value->world())->releaseGlobal());
+ }
}
-void WindowProxyManagerBase::setGlobals(
- const HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>& map) {
- for (auto& entry : map)
- windowProxy(*entry.key)->setGlobal(entry.value);
+void WindowProxyManagerBase::setGlobals(const GlobalsVector& globals) {
+ for (const auto& entry : globals)
+ windowProxy(*entry.first)->setGlobal(entry.second);
}
WindowProxyManagerBase::WindowProxyManagerBase(Frame& frame)
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h ('k') | third_party/WebKit/Source/web/WebFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698