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

Side by Side Diff: third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp

Issue 1745253002: [Worklets] Add basic debugging to main thread worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix non-oilpan build. Created 4 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
« no previous file with comments | « third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "modules/worklet/WorkletGlobalScope.h" 5 #include "modules/worklet/WorkletGlobalScope.h"
6 6
7 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 7 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
8 #include "core/frame/FrameConsole.h" 8 #include "core/frame/FrameConsole.h"
9 #include "core/inspector/InspectorInstrumentation.h" 9 #include "core/inspector/InspectorInstrumentation.h"
10 #include "core/inspector/MainThreadDebugger.h"
10 #include "modules/worklet/WorkletConsole.h" 11 #include "modules/worklet/WorkletConsole.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 // static 15 // static
15 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(LocalFrame * frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> se curityOrigin, v8::Isolate* isolate) 16 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(LocalFrame * frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> se curityOrigin, v8::Isolate* isolate)
16 { 17 {
17 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo op(new WorkletGlobalScope(frame, url, userAgent, securityOrigin, isolate)); 18 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo op(new WorkletGlobalScope(frame, url, userAgent, securityOrigin, isolate));
18 workletGlobalScope->scriptController()->initializeContextIfNeeded(); 19 workletGlobalScope->scriptController()->initializeContextIfNeeded();
20 MainThreadDebugger::contextCreated(workletGlobalScope->scriptController()->g etScriptState(), workletGlobalScope->frame(), workletGlobalScope->getSecurityOri gin());
19 return workletGlobalScope.release(); 21 return workletGlobalScope.release();
20 } 22 }
21 23
22 WorkletGlobalScope::WorkletGlobalScope(LocalFrame* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isol ate) 24 WorkletGlobalScope::WorkletGlobalScope(LocalFrame* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isol ate)
23 : LocalFrameLifecycleObserver(frame) 25 : MainThreadWorkletGlobalScope(frame)
24 , m_url(url) 26 , m_url(url)
25 , m_userAgent(userAgent) 27 , m_userAgent(userAgent)
26 , m_scriptController(WorkerOrWorkletScriptController::create(this, isolate)) 28 , m_scriptController(WorkerOrWorkletScriptController::create(this, isolate))
27 { 29 {
28 setSecurityOrigin(securityOrigin); 30 setSecurityOrigin(securityOrigin);
29 } 31 }
30 32
31 WorkletGlobalScope::~WorkletGlobalScope() 33 WorkletGlobalScope::~WorkletGlobalScope()
32 { 34 {
33 } 35 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Always use UTF-8 in Worklets. 100 // Always use UTF-8 in Worklets.
99 return KURL(m_url, url); 101 return KURL(m_url, url);
100 } 102 }
101 103
102 DEFINE_TRACE(WorkletGlobalScope) 104 DEFINE_TRACE(WorkletGlobalScope)
103 { 105 {
104 visitor->trace(m_scriptController); 106 visitor->trace(m_scriptController);
105 visitor->trace(m_console); 107 visitor->trace(m_console);
106 ExecutionContext::trace(visitor); 108 ExecutionContext::trace(visitor);
107 SecurityContext::trace(visitor); 109 SecurityContext::trace(visitor);
108 LocalFrameLifecycleObserver::trace(visitor); 110 MainThreadWorkletGlobalScope::trace(visitor);
109 } 111 }
110 112
111 } // namespace blink 113 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698