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

Unified Diff: Source/bindings/core/v8/DOMWrapperWorld.cpp

Issue 15764004: DevTools: show extension name in console context switcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. Created 6 years, 4 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: Source/bindings/core/v8/DOMWrapperWorld.cpp
diff --git a/Source/bindings/core/v8/DOMWrapperWorld.cpp b/Source/bindings/core/v8/DOMWrapperWorld.cpp
index e1dc37478369989d038b26fb2add591920e5492b..5b506a6b0d4d7313d9c7099f7ef4e0ac90e1a2ce 100644
--- a/Source/bindings/core/v8/DOMWrapperWorld.cpp
+++ b/Source/bindings/core/v8/DOMWrapperWorld.cpp
@@ -172,6 +172,31 @@ void DOMWrapperWorld::setIsolatedWorldSecurityOrigin(int worldId, PassRefPtr<Sec
isolatedWorldSecurityOrigins().remove(worldId);
}
+typedef HashMap<int, String > IsolatedWorldHumanReadableNameMap;
+static IsolatedWorldHumanReadableNameMap& isolatedWorldHumanReadableNames()
+{
+ ASSERT(isMainThread());
+ DEFINE_STATIC_LOCAL(IsolatedWorldHumanReadableNameMap, map, ());
+ return map;
+}
+
+String DOMWrapperWorld::isolatedWorldHumanReadableName()
+{
+ ASSERT(this->isIsolatedWorld());
+ IsolatedWorldHumanReadableNameMap& humanReadableNames = isolatedWorldHumanReadableNames();
+ IsolatedWorldHumanReadableNameMap::iterator it = humanReadableNames.find(worldId());
yurys 2014/08/25 09:22:30 humanReadableNames.get(worldId()) ?
lushnikov 2014/08/27 08:20:26 Done.
+ return it == humanReadableNames.end() ? "" : it->value;
+}
+
+void DOMWrapperWorld::setIsolatedWorldHumanReadableName(int worldId, const String& humanReadableName)
+{
+ ASSERT(isIsolatedWorldId(worldId));
+ if (!humanReadableName.isEmpty())
yurys 2014/08/25 09:22:30 Why do you need this check?
lushnikov 2014/08/27 08:20:26 Done.
+ isolatedWorldHumanReadableNames().set(worldId, humanReadableName);
+ else
+ isolatedWorldHumanReadableNames().remove(worldId);
+}
+
typedef HashMap<int, bool> IsolatedWorldContentSecurityPolicyMap;
static IsolatedWorldContentSecurityPolicyMap& isolatedWorldContentSecurityPolicies()
{

Powered by Google App Engine
This is Rietveld 408576698