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

Side by Side Diff: Source/bindings/v8/DOMWrapperWorld.cpp

Issue 180743013: Ensure DOMWrapperWorld always exists in all webkit_unit_tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/IDBBindingUtilitiesTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 ASSERT(i->value == this); 108 ASSERT(i->value == this);
109 109
110 map.remove(i); 110 map.remove(i);
111 isolatedWorldCount--; 111 isolatedWorldCount--;
112 ASSERT(map.size() == isolatedWorldCount); 112 ASSERT(map.size() == isolatedWorldCount);
113 } 113 }
114 114
115 #ifndef NDEBUG 115 #ifndef NDEBUG
116 static bool isIsolatedWorldId(int worldId) 116 static bool isIsolatedWorldId(int worldId)
117 { 117 {
118 return worldId != MainWorldId && worldId != WorkerWorldId; 118 return MainWorldId < worldId && worldId < IsolatedWorldIdLimit;
119 } 119 }
120 #endif 120 #endif
121 121
122 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in t extensionGroup) 122 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, in t extensionGroup)
123 { 123 {
124 ASSERT(isIsolatedWorldId(worldId)); 124 ASSERT(isIsolatedWorldId(worldId));
125 125
126 WorldMap& map = isolatedWorldMap(); 126 WorldMap& map = isolatedWorldMap();
127 WorldMap::AddResult result = map.add(worldId, 0); 127 WorldMap::AddResult result = map.add(worldId, 0);
128 RefPtr<DOMWrapperWorld> world = result.storedValue->value; 128 RefPtr<DOMWrapperWorld> world = result.storedValue->value;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 ASSERT(isIsolatedWorldId(worldId)); 201 ASSERT(isIsolatedWorldId(worldId));
202 isolatedWorldContentSecurityPolicies().remove(worldId); 202 isolatedWorldContentSecurityPolicies().remove(worldId);
203 } 203 }
204 204
205 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context ) 205 bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context )
206 { 206 {
207 return V8WindowShell::contextHasCorrectPrototype(context); 207 return V8WindowShell::contextHasCorrectPrototype(context);
208 } 208 }
209 209
210 } // namespace WebCore 210 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/IDBBindingUtilitiesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698