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

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

Issue 168583005: Remove DOMWrapperWorld::isIsolatedWorldId and DOMWrapperWorld::context (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/PageScriptDebugServer.cpp » ('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 250c3f1a979ccf0288b0b75265f771b07fa01900..0ad1de2fbfe9a7c60fa4ddda8a6e5b08a46f7140 100644
--- a/Source/bindings/v8/DOMWrapperWorld.cpp
+++ b/Source/bindings/v8/DOMWrapperWorld.cpp
@@ -119,6 +119,13 @@ DOMWrapperWorld::~DOMWrapperWorld()
ASSERT(map.size() == isolatedWorldCount);
}
+#ifndef NDEBUG
+static bool isIsolatedWorldId(int worldId)
+{
+ return worldId != MainWorldId && worldId != WorkerWorldId;
+}
+#endif
+
PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, int extensionGroup)
{
ASSERT(isIsolatedWorldId(worldId));
@@ -140,11 +147,6 @@ PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in
return world.release();
}
-v8::Handle<v8::Context> DOMWrapperWorld::context(ScriptController& controller)
-{
- return controller.windowShell(this)->context();
-}
-
typedef HashMap<int, RefPtr<SecurityOrigin> > IsolatedWorldSecurityOriginMap;
static IsolatedWorldSecurityOriginMap& isolatedWorldSecurityOrigins()
{
@@ -163,7 +165,7 @@ SecurityOrigin* DOMWrapperWorld::isolatedWorldSecurityOrigin()
void DOMWrapperWorld::setIsolatedWorldSecurityOrigin(int worldId, PassRefPtr<SecurityOrigin> securityOrigin)
{
- ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldId));
+ ASSERT(isIsolatedWorldId(worldId));
if (securityOrigin)
isolatedWorldSecurityOrigins().set(worldId, securityOrigin);
else
@@ -172,7 +174,7 @@ void DOMWrapperWorld::setIsolatedWorldSecurityOrigin(int worldId, PassRefPtr<Sec
void DOMWrapperWorld::clearIsolatedWorldSecurityOrigin(int worldId)
{
- ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldId));
+ ASSERT(isIsolatedWorldId(worldId));
isolatedWorldSecurityOrigins().remove(worldId);
}
@@ -194,7 +196,7 @@ bool DOMWrapperWorld::isolatedWorldHasContentSecurityPolicy()
void DOMWrapperWorld::setIsolatedWorldContentSecurityPolicy(int worldId, const String& policy)
{
- ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldId));
+ ASSERT(isIsolatedWorldId(worldId));
if (!policy.isEmpty())
isolatedWorldContentSecurityPolicies().set(worldId, true);
else
@@ -203,7 +205,7 @@ void DOMWrapperWorld::setIsolatedWorldContentSecurityPolicy(int worldId, const S
void DOMWrapperWorld::clearIsolatedWorldContentSecurityPolicy(int worldId)
{
- ASSERT(DOMWrapperWorld::isIsolatedWorldId(worldId));
+ ASSERT(isIsolatedWorldId(worldId));
isolatedWorldContentSecurityPolicies().remove(worldId);
}
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/PageScriptDebugServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698