Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MainThreadWorkletGlobalScope_h | 5 #ifndef MainThreadWorkletGlobalScope_h |
| 6 #define MainThreadWorkletGlobalScope_h | 6 #define MainThreadWorkletGlobalScope_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| 11 #include "core/workers/WorkletGlobalScope.h" | 11 #include "core/workers/WorkletGlobalScope.h" |
| 12 #include "core/workers/WorkletPendingTasks.h" | 12 #include "core/workers/WorkletPendingTasks.h" |
| 13 #include "public/platform/WebURLRequest.h" | 13 #include "public/platform/WebURLRequest.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class ConsoleMessage; | 17 class ConsoleMessage; |
| 18 class LocalFrame; | 18 class LocalFrame; |
| 19 class ParentFrameTaskRunners; | |
| 19 | 20 |
| 20 class CORE_EXPORT MainThreadWorkletGlobalScope | 21 class CORE_EXPORT MainThreadWorkletGlobalScope |
| 21 : public WorkletGlobalScope, | 22 : public WorkletGlobalScope, |
| 22 public ContextClient { | 23 public ContextClient { |
| 23 USING_GARBAGE_COLLECTED_MIXIN(MainThreadWorkletGlobalScope); | 24 USING_GARBAGE_COLLECTED_MIXIN(MainThreadWorkletGlobalScope); |
| 24 | 25 |
| 25 public: | 26 public: |
| 26 MainThreadWorkletGlobalScope(LocalFrame*, | 27 MainThreadWorkletGlobalScope(LocalFrame*, |
| 27 const KURL&, | 28 const KURL&, |
| 28 const String& user_agent, | 29 const String& user_agent, |
| 29 PassRefPtr<SecurityOrigin>, | 30 PassRefPtr<SecurityOrigin>, |
| 30 v8::Isolate*); | 31 v8::Isolate*); |
| 31 ~MainThreadWorkletGlobalScope() override; | 32 ~MainThreadWorkletGlobalScope() override; |
| 32 bool IsMainThreadWorkletGlobalScope() const final { return true; } | 33 bool IsMainThreadWorkletGlobalScope() const final { return true; } |
| 33 | 34 |
| 34 // WorkerOrWorkletGlobalScope | 35 // WorkerOrWorkletGlobalScope |
| 35 void ReportFeature(UseCounter::Feature) override; | 36 void ReportFeature(UseCounter::Feature) override; |
| 36 void ReportDeprecation(UseCounter::Feature) override; | 37 void ReportDeprecation(UseCounter::Feature) override; |
| 37 WorkerThread* GetThread() const final; | 38 WorkerThread* GetThread() const final; |
| 38 | 39 |
| 39 void FetchAndInvokeScript(const KURL& module_url_record, | 40 void FetchAndInvokeScript(const KURL& module_url_record, |
| 40 WebURLRequest::FetchCredentialsMode, | 41 WebURLRequest::FetchCredentialsMode, |
| 42 ParentFrameTaskRunners*, | |
|
falken
2017/05/30 01:33:23
I'm not sure it's clear what ParentFrameTaskRunner
nhiroki
2017/05/30 02:14:23
Added function comments.
I feel "ParentFrameTaskR
| |
| 41 WorkletPendingTasks*); | 43 WorkletPendingTasks*); |
| 42 void Terminate(); | 44 void Terminate(); |
| 43 | 45 |
| 44 // ExecutionContext | 46 // ExecutionContext |
| 45 void AddConsoleMessage(ConsoleMessage*) final; | 47 void AddConsoleMessage(ConsoleMessage*) final; |
| 46 void ExceptionThrown(ErrorEvent*) final; | 48 void ExceptionThrown(ErrorEvent*) final; |
| 47 CoreProbeSink* GetProbeSink() final; | 49 CoreProbeSink* GetProbeSink() final; |
| 48 | 50 |
| 49 DECLARE_VIRTUAL_TRACE(); | 51 DECLARE_VIRTUAL_TRACE(); |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, | 54 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, |
| 53 ExecutionContext, | 55 ExecutionContext, |
| 54 context, | 56 context, |
| 55 context->IsMainThreadWorkletGlobalScope(), | 57 context->IsMainThreadWorkletGlobalScope(), |
| 56 context.IsMainThreadWorkletGlobalScope()); | 58 context.IsMainThreadWorkletGlobalScope()); |
| 57 | 59 |
| 58 } // namespace blink | 60 } // namespace blink |
| 59 | 61 |
| 60 #endif // MainThreadWorkletGlobalScope_h | 62 #endif // MainThreadWorkletGlobalScope_h |
| OLD | NEW |