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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp

Issue 2873283002: [Reland] Allow headless TabSocket in isolated worlds & remove obsolete logic (Closed)
Patch Set: Fix GN Issue Created 3 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 unified diff | Download patch
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 case WorldType::kMain: 270 case WorldType::kMain:
271 return kMainWorldId; 271 return kMainWorldId;
272 case WorldType::kIsolated: 272 case WorldType::kIsolated:
273 // This function should not be called for IsolatedWorld because an 273 // This function should not be called for IsolatedWorld because an
274 // identifier for the world is given from out of DOMWrapperWorld. 274 // identifier for the world is given from out of DOMWrapperWorld.
275 NOTREACHED(); 275 NOTREACHED();
276 return kInvalidWorldId; 276 return kInvalidWorldId;
277 case WorldType::kInspectorIsolated: { 277 case WorldType::kInspectorIsolated: {
278 DCHECK(IsMainThread()); 278 DCHECK(IsMainThread());
279 static int next_devtools_isolated_world_id = 279 static int next_devtools_isolated_world_id =
280 WorldId::kDevToolsFirstIsolatedWorldId; 280 IsolatedWorldId::kDevToolsFirstIsolatedWorldId;
281 if (next_devtools_isolated_world_id > 281 if (next_devtools_isolated_world_id >
282 WorldId::kDevToolsLastIsolatedWorldId) 282 IsolatedWorldId::kDevToolsLastIsolatedWorldId)
283 return WorldId::kInvalidWorldId; 283 return WorldId::kInvalidWorldId;
284 return next_devtools_isolated_world_id++; 284 return next_devtools_isolated_world_id++;
285 } 285 }
286 case WorldType::kGarbageCollector: 286 case WorldType::kGarbageCollector:
287 case WorldType::kRegExp: 287 case WorldType::kRegExp:
288 case WorldType::kTesting: 288 case WorldType::kTesting:
289 case WorldType::kWorker: 289 case WorldType::kWorker:
290 int world_id = *next_world_id; 290 int world_id = *next_world_id;
291 CHECK_GE(world_id, WorldId::kUnspecifiedWorldIdStart); 291 CHECK_GE(world_id, WorldId::kUnspecifiedWorldIdStart);
292 *next_world_id = world_id + 1; 292 *next_world_id = world_id + 1;
293 return world_id; 293 return world_id;
294 } 294 }
295 NOTREACHED(); 295 NOTREACHED();
296 return kInvalidWorldId; 296 return kInvalidWorldId;
297 } 297 }
298 298
299 void DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds( 299 void DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds(
300 ScriptWrappable* script_wrappable) { 300 ScriptWrappable* script_wrappable) {
301 DCHECK(script_wrappable); 301 DCHECK(script_wrappable);
302 DCHECK(IsMainThread()); 302 DCHECK(IsMainThread());
303 303
304 script_wrappable->UnsetWrapperIfAny(); 304 script_wrappable->UnsetWrapperIfAny();
305 305
306 for (auto& world : GetWorldMap().Values()) 306 for (auto& world : GetWorldMap().Values())
307 world->DomDataStore().UnsetWrapperIfAny(script_wrappable); 307 world->DomDataStore().UnsetWrapperIfAny(script_wrappable);
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698