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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptNative.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/InjectedScriptNative.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptNative.cpp b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptNative.cpp
index 615e228414a2d0f8b1604b35fa285e95c99fa1fd..8dd253f4a51703fe5a5bec0f184ff2f7d8f7d25b 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptNative.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScriptNative.cpp
@@ -5,7 +5,6 @@
#include "platform/v8_inspector/InjectedScriptNative.h"
#include "platform/inspector_protocol/Values.h"
-#include "wtf/Vector.h"
namespace blink {
@@ -67,11 +66,12 @@ void InjectedScriptNative::addObjectToGroup(int objectId, const String& groupNam
if (objectId <= 0)
return;
m_idToObjectGroupName.set(objectId, groupName);
- NameToObjectGroup::iterator groupIt = m_nameToObjectGroup.find(groupName);
- if (groupIt == m_nameToObjectGroup.end())
- m_nameToObjectGroup.set(groupName, Vector<int>()).storedValue->value.append(objectId);
- else
- groupIt->value.append(objectId);
+ auto it = m_nameToObjectGroup.find(groupName);
+ if (it == m_nameToObjectGroup.end()) {
+ m_nameToObjectGroup.set(groupName, protocol::Vector<int>());
+ it = m_nameToObjectGroup.find(groupName);
+ }
+ it->second->append(objectId);
}
void InjectedScriptNative::releaseObjectGroup(const String& groupName)
@@ -81,9 +81,9 @@ void InjectedScriptNative::releaseObjectGroup(const String& groupName)
NameToObjectGroup::iterator groupIt = m_nameToObjectGroup.find(groupName);
if (groupIt == m_nameToObjectGroup.end())
return;
- for (int id : groupIt->value)
+ for (int id : *groupIt->second)
unbind(id);
- m_nameToObjectGroup.remove(groupIt);
+ m_nameToObjectGroup.remove(groupName);
}
String InjectedScriptNative::groupName(int objectId) const

Powered by Google App Engine
This is Rietveld 408576698