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

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

Issue 2873283002: [Reland] Allow headless TabSocket in isolated worlds & remove obsolete logic (Closed)
Patch Set: Fix GN Issue Created 3 years, 6 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 21 matching lines...) Expand all
32 #define DOMWrapperWorld_h 32 #define DOMWrapperWorld_h
33 33
34 #include <memory> 34 #include <memory>
35 35
36 #include "platform/PlatformExport.h" 36 #include "platform/PlatformExport.h"
37 #include "platform/bindings/ScriptState.h" 37 #include "platform/bindings/ScriptState.h"
38 #include "platform/weborigin/SecurityOrigin.h" 38 #include "platform/weborigin/SecurityOrigin.h"
39 #include "platform/wtf/PassRefPtr.h" 39 #include "platform/wtf/PassRefPtr.h"
40 #include "platform/wtf/RefCounted.h" 40 #include "platform/wtf/RefCounted.h"
41 #include "platform/wtf/RefPtr.h" 41 #include "platform/wtf/RefPtr.h"
42 #include "public/platform/WebIsolatedWorldIds.h"
42 #include "v8/include/v8.h" 43 #include "v8/include/v8.h"
43 44
44 namespace blink { 45 namespace blink {
45 46
46 class DOMDataStore; 47 class DOMDataStore;
47 class DOMObjectHolderBase; 48 class DOMObjectHolderBase;
48 49
49 // This class represent a collection of DOM wrappers for a specific world. This 50 // This class represent a collection of DOM wrappers for a specific world. This
50 // is identified by a world id that is a per-thread global identifier (see 51 // is identified by a world id that is a per-thread global identifier (see
51 // WorldId enum). 52 // WorldId enum).
52 class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { 53 class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
53 public: 54 public:
54 // Per-thread global identifiers for DOMWrapperWorld. 55 // Per-thread global identifiers for DOMWrapperWorld.
55 enum WorldId { 56 enum WorldId {
56 kInvalidWorldId = -1, 57 kInvalidWorldId = -1,
57 kMainWorldId = 0, 58 kMainWorldId = 0,
58 59
59 // Embedder isolated worlds can use IDs in [1, 1<<29). 60 kEmbedderWorldIdLimit = IsolatedWorldId::kEmbedderWorldIdLimit,
60 kEmbedderWorldIdLimit = (1 << 29), 61 kIsolatedWorldIdLimit = IsolatedWorldId::kIsolatedWorldIdLimit,
61 kDocumentXMLTreeViewerWorldId,
62 kDevToolsFirstIsolatedWorldId,
63 kDevToolsLastIsolatedWorldId = kDevToolsFirstIsolatedWorldId + 100,
64 kIsolatedWorldIdLimit,
65 62
66 // Other worlds can use IDs after this. Don't manually pick up an ID from 63 // Other worlds can use IDs after this. Don't manually pick up an ID from
67 // this range. generateWorldIdForType() picks it up on behalf of you. 64 // this range. generateWorldIdForType() picks it up on behalf of you.
68 kUnspecifiedWorldIdStart, 65 kUnspecifiedWorldIdStart,
69 }; 66 };
70 67
71 enum class WorldType { 68 enum class WorldType {
72 kMain, 69 kMain,
73 kIsolated, 70 kIsolated,
74 kInspectorIsolated, 71 kInspectorIsolated,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 222
226 const WorldType world_type_; 223 const WorldType world_type_;
227 const int world_id_; 224 const int world_id_;
228 std::unique_ptr<DOMDataStore> dom_data_store_; 225 std::unique_ptr<DOMDataStore> dom_data_store_;
229 HashSet<std::unique_ptr<DOMObjectHolderBase>> dom_object_holders_; 226 HashSet<std::unique_ptr<DOMObjectHolderBase>> dom_object_holders_;
230 }; 227 };
231 228
232 } // namespace blink 229 } // namespace blink
233 230
234 #endif // DOMWrapperWorld_h 231 #endif // DOMWrapperWorld_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698