OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 #include "platform/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
45 #include "platform/loader/fetch/CachedMetadataHandler.h" | 45 #include "platform/loader/fetch/CachedMetadataHandler.h" |
46 #include "platform/wtf/ListHashSet.h" | 46 #include "platform/wtf/ListHashSet.h" |
47 | 47 |
48 namespace blink { | 48 namespace blink { |
49 | 49 |
50 class ConsoleMessage; | 50 class ConsoleMessage; |
51 class ExceptionState; | 51 class ExceptionState; |
52 class V8AbstractEventListener; | 52 class V8AbstractEventListener; |
53 class WorkerClients; | 53 class WorkerClients; |
54 class WorkerFetchContext; | |
54 class WorkerLocation; | 55 class WorkerLocation; |
55 class WorkerNavigator; | 56 class WorkerNavigator; |
56 class WorkerThread; | 57 class WorkerThread; |
57 | 58 |
58 class CORE_EXPORT WorkerGlobalScope | 59 class CORE_EXPORT WorkerGlobalScope |
59 : public EventTargetWithInlineData, | 60 : public EventTargetWithInlineData, |
60 public ActiveScriptWrappable<WorkerGlobalScope>, | 61 public ActiveScriptWrappable<WorkerGlobalScope>, |
61 public SecurityContext, | 62 public SecurityContext, |
62 public WorkerOrWorkletGlobalScope, | 63 public WorkerOrWorkletGlobalScope, |
63 public Supplementable<WorkerGlobalScope>, | 64 public Supplementable<WorkerGlobalScope>, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 | 147 |
147 double TimeOrigin() const { return time_origin_; } | 148 double TimeOrigin() const { return time_origin_; } |
148 WorkerSettings* GetWorkerSettings() const { return worker_settings_.get(); } | 149 WorkerSettings* GetWorkerSettings() const { return worker_settings_.get(); } |
149 | 150 |
150 WorkerOrWorkletScriptController* ScriptController() final { | 151 WorkerOrWorkletScriptController* ScriptController() final { |
151 return script_controller_.Get(); | 152 return script_controller_.Get(); |
152 } | 153 } |
153 | 154 |
154 WorkerClients* Clients() const { return worker_clients_.Get(); } | 155 WorkerClients* Clients() const { return worker_clients_.Get(); } |
155 | 156 |
157 // Available only when off-main-thread-fetch is enabled. | |
158 WorkerFetchContext* FetchContext(); | |
kinuko
2017/04/20 04:08:14
nit: GetFetchContext()
horo
2017/04/20 08:35:43
Done.
| |
159 | |
156 DECLARE_VIRTUAL_TRACE(); | 160 DECLARE_VIRTUAL_TRACE(); |
157 | 161 |
158 protected: | 162 protected: |
159 WorkerGlobalScope(const KURL&, | 163 WorkerGlobalScope(const KURL&, |
160 const String& user_agent, | 164 const String& user_agent, |
161 WorkerThread*, | 165 WorkerThread*, |
162 double time_origin, | 166 double time_origin, |
163 std::unique_ptr<SecurityOrigin::PrivilegeData>, | 167 std::unique_ptr<SecurityOrigin::PrivilegeData>, |
164 WorkerClients*); | 168 WorkerClients*); |
165 void SetWorkerSettings(std::unique_ptr<WorkerSettings>); | 169 void SetWorkerSettings(std::unique_ptr<WorkerSettings>); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 CrossThreadPersistent<WorkerClients> worker_clients_; | 205 CrossThreadPersistent<WorkerClients> worker_clients_; |
202 | 206 |
203 DOMTimerCoordinator timers_; | 207 DOMTimerCoordinator timers_; |
204 | 208 |
205 const double time_origin_; | 209 const double time_origin_; |
206 | 210 |
207 HeapHashSet<Member<V8AbstractEventListener>> event_listeners_; | 211 HeapHashSet<Member<V8AbstractEventListener>> event_listeners_; |
208 | 212 |
209 HeapHashMap<int, Member<ErrorEvent>> pending_error_events_; | 213 HeapHashMap<int, Member<ErrorEvent>> pending_error_events_; |
210 int last_pending_error_event_id_; | 214 int last_pending_error_event_id_; |
215 | |
216 Member<WorkerFetchContext> fetch_context_; | |
211 }; | 217 }; |
212 | 218 |
213 DEFINE_TYPE_CASTS(WorkerGlobalScope, | 219 DEFINE_TYPE_CASTS(WorkerGlobalScope, |
214 ExecutionContext, | 220 ExecutionContext, |
215 context, | 221 context, |
216 context->IsWorkerGlobalScope(), | 222 context->IsWorkerGlobalScope(), |
217 context.IsWorkerGlobalScope()); | 223 context.IsWorkerGlobalScope()); |
218 | 224 |
219 } // namespace blink | 225 } // namespace blink |
220 | 226 |
221 #endif // WorkerGlobalScope_h | 227 #endif // WorkerGlobalScope_h |
OLD | NEW |