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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptManager.cpp

Issue 1758313002: DevTools: introduce collections shim to be backed by non-wtf in v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing Created 4 years, 10 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/platform/v8_inspector/InjectedScriptManager.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptManager.cpp b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptManager.cpp
index b45ab1b95b1a8d092c923f4e9b33dbfc90e5d301..f4c81cc56f61d46d6e4fd8560e75c757f41f8f48 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptManager.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptManager.cpp
@@ -69,7 +69,7 @@ InjectedScript* InjectedScriptManager::findInjectedScript(int id) const
{
IdToInjectedScriptMap::const_iterator it = m_idToInjectedScript.find(id);
if (it != m_idToInjectedScript.end())
- return it->value.get();
+ return it->second;
return nullptr;
}
@@ -97,12 +97,12 @@ void InjectedScriptManager::discardInjectedScript(int contextId)
void InjectedScriptManager::releaseObjectGroup(const String& objectGroup)
{
- Vector<int> keys;
- keys.appendRange(m_idToInjectedScript.keys().begin(), m_idToInjectedScript.keys().end());
+ protocol::Vector<int> keys;
+ for (auto& it : m_idToInjectedScript)
+ keys.append(it.first);
for (auto& key : keys) {
- IdToInjectedScriptMap::iterator s = m_idToInjectedScript.find(key);
- if (s != m_idToInjectedScript.end())
- s->value->releaseObjectGroup(objectGroup); // m_idToInjectedScript may change here.
+ if (m_idToInjectedScript.contains(key)) // m_idToInjectedScript may change here.
+ m_idToInjectedScript.get(key)->releaseObjectGroup(objectGroup);
}
}
@@ -111,7 +111,7 @@ void InjectedScriptManager::setCustomObjectFormatterEnabled(bool enabled)
m_customObjectFormatterEnabled = enabled;
IdToInjectedScriptMap::iterator end = m_idToInjectedScript.end();
for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it != end; ++it) {
- it->value->setCustomObjectFormatterEnabled(enabled);
+ it->second->setCustomObjectFormatterEnabled(enabled);
}
}
@@ -122,7 +122,7 @@ InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8::Context>
IdToInjectedScriptMap::iterator it = m_idToInjectedScript.find(contextId);
if (it != m_idToInjectedScript.end())
- return it->value.get();
+ return it->second;
v8::Local<v8::Context> callingContext = context->GetIsolate()->GetCallingContext();
if (!callingContext.IsEmpty() && !m_client->callingContextCanAccessContext(callingContext, context))
@@ -137,6 +137,7 @@ InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8::Context>
if (m_customObjectFormatterEnabled)
result->setCustomObjectFormatterEnabled(m_customObjectFormatterEnabled);
m_idToInjectedScript.set(contextId, result.release());
+
return resultPtr;
}

Powered by Google App Engine
This is Rietveld 408576698