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

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: removing v8 api from agent code 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
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/ScriptState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, ());
pfeldman 2013/08/05 16:44:49 You should not create yet another map, we can exte
lushnikov 2014/08/23 20:37:46 So I've got to create this map due to the fact tha
+ 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());
+ return it == humanReadableNames.end() ? "" : it->value;
+}
+
void DOMWrapperWorld::clearIsolatedWorldSecurityOrigin(int worldID)
{
ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldID));
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/ScriptState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698