Chromium Code Reviews| 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() |
| { |