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

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

Issue 15764004: DevTools: show extension name in console context switcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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/v8/DOMWrapperWorld.cpp
diff --git a/Source/bindings/v8/DOMWrapperWorld.cpp b/Source/bindings/v8/DOMWrapperWorld.cpp
index 7b5f2fd86fd5d9c2729531b6664cf9ddf37280d3..95d5c9e6ad5efbba13a3dde49ec50bfd971481ed 100644
--- a/Source/bindings/v8/DOMWrapperWorld.cpp
+++ b/Source/bindings/v8/DOMWrapperWorld.cpp
@@ -169,6 +169,14 @@ static IsolatedWorldSecurityOriginMap& isolatedWorldSecurityOrigins()
return map;
}
+typedef HashMap<int, String> IsolatedWorldHumanReadableNameMap;
+static IsolatedWorldHumanReadableNameMap& isolatedWorldHumanReadableNames()
+{
+ ASSERT(isMainThread());
+ DEFINE_STATIC_LOCAL(IsolatedWorldHumanReadableNameMap, map, ());
+ return map;
+}
+
SecurityOrigin* DOMWrapperWorld::isolatedWorldSecurityOrigin()
{
ASSERT(this->isIsolatedWorld());
@@ -186,6 +194,23 @@ void DOMWrapperWorld::setIsolatedWorldSecurityOrigin(int worldID, PassRefPtr<Sec
isolatedWorldSecurityOrigins().remove(worldID);
}
+void DOMWrapperWorld::setIsolatedWorldHumanReadableName(int worldID, const String& humanReadableName)
+{
+ ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldID));
+ if (!humanReadableName.isEmpty())
+ isolatedWorldHumanReadableNames().set(worldID, humanReadableName);
+ else
+ isolatedWorldHumanReadableNames().remove(worldID);
+}
+
+String DOMWrapperWorld::isolatedWorldHumanReadableName()
+{
+ ASSERT(this->isIsolatedWorld());
+ IsolatedWorldHumanReadableNameMap& humanReadableNames = isolatedWorldHumanReadableNames();
+ IsolatedWorldHumanReadableNameMap::iterator it = humanReadableNames.find(worldId());
yurys 2013/05/24 04:58:44 Hm, why does DOMWrapperWorld use several static st
+ return it == humanReadableNames.end() ? "" : it->value;
+}
+
void DOMWrapperWorld::clearIsolatedWorldSecurityOrigin(int worldID)
{
ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldID));

Powered by Google App Engine
This is Rietveld 408576698