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

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

Issue 2087953004: Switch v8 inspector to stl collections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually remove a value from the list Created 4 years, 6 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/V8RuntimeAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
index dc45b11875ec863bec1b1723311002cc743e717e..2c64df1beef97dc2cec6ea10997653804d5cdf7e 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
@@ -295,7 +295,7 @@ void V8RuntimeAgentImpl::compileScript(ErrorString* errorString,
String16 scriptValueId = String16::number(script->GetUnboundScript()->GetId());
std::unique_ptr<v8::Global<v8::Script>> global(new v8::Global<v8::Script>(m_debugger->isolate(), script));
- m_compiledScripts.set(scriptValueId, std::move(global));
+ m_compiledScripts[scriptValueId] = std::move(global);
*scriptId = scriptValueId;
}
@@ -313,7 +313,8 @@ void V8RuntimeAgentImpl::runScript(ErrorString* errorString,
return;
}
- if (!m_compiledScripts.contains(scriptId)) {
+ auto iter = m_compiledScripts.find(scriptId);
dgozman 2016/06/24 17:01:14 iter -> it
eostroukhov-old 2016/06/24 22:24:26 Done.
+ if (iter == m_compiledScripts.end()) {
*errorString = "Script execution failed";
return;
}
@@ -325,7 +326,8 @@ void V8RuntimeAgentImpl::runScript(ErrorString* errorString,
if (doNotPauseOnExceptionsAndMuteConsole.fromMaybe(false))
scope.ignoreExceptionsAndMuteConsole();
- std::unique_ptr<v8::Global<v8::Script>> scriptWrapper = m_compiledScripts.take(scriptId);
+ std::unique_ptr<v8::Global<v8::Script>> scriptWrapper = std::move(iter->second);
+ m_compiledScripts.erase(iter);
v8::Local<v8::Script> script = scriptWrapper->Get(m_debugger->isolate());
if (script.IsEmpty()) {
*errorString = "Script execution failed";

Powered by Google App Engine
This is Rietveld 408576698