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

Side by Side Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 2794023002: Move ScriptState::forWorld/ScriptState::forMainWorld (Part 1) (Closed)
Patch Set: Code review changes Created 3 years, 8 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) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "core/inspector/MainThreadDebugger.h" 31 #include "core/inspector/MainThreadDebugger.h"
32 32
33 #include <memory> 33 #include <memory>
34 34
35 #include "bindings/core/v8/BindingSecurity.h" 35 #include "bindings/core/v8/BindingSecurity.h"
36 #include "bindings/core/v8/DOMWrapperWorld.h" 36 #include "bindings/core/v8/DOMWrapperWorld.h"
37 #include "bindings/core/v8/ScriptController.h" 37 #include "bindings/core/v8/ScriptController.h"
38 #include "bindings/core/v8/SourceLocation.h" 38 #include "bindings/core/v8/SourceLocation.h"
39 #include "bindings/core/v8/V8Binding.h"
39 #include "bindings/core/v8/V8ErrorHandler.h" 40 #include "bindings/core/v8/V8ErrorHandler.h"
40 #include "bindings/core/v8/V8Node.h" 41 #include "bindings/core/v8/V8Node.h"
41 #include "bindings/core/v8/V8Window.h" 42 #include "bindings/core/v8/V8Window.h"
42 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 43 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
43 #include "core/dom/ContainerNode.h" 44 #include "core/dom/ContainerNode.h"
44 #include "core/dom/Document.h" 45 #include "core/dom/Document.h"
45 #include "core/dom/Element.h" 46 #include "core/dom/Element.h"
46 #include "core/dom/ExecutionContext.h" 47 #include "core/dom/ExecutionContext.h"
47 #include "core/dom/StaticNodeList.h" 48 #include "core/dom/StaticNodeList.h"
48 #include "core/events/ErrorEvent.h" 49 #include "core/events/ErrorEvent.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 172 }
172 173
173 void MainThreadDebugger::exceptionThrown(ExecutionContext* context, 174 void MainThreadDebugger::exceptionThrown(ExecutionContext* context,
174 ErrorEvent* event) { 175 ErrorEvent* event) {
175 LocalFrame* frame = nullptr; 176 LocalFrame* frame = nullptr;
176 ScriptState* scriptState = nullptr; 177 ScriptState* scriptState = nullptr;
177 if (context->isDocument()) { 178 if (context->isDocument()) {
178 frame = toDocument(context)->frame(); 179 frame = toDocument(context)->frame();
179 if (!frame) 180 if (!frame)
180 return; 181 return;
181 scriptState = event->world() ? ScriptState::forWorld(frame, *event->world()) 182 scriptState =
182 : nullptr; 183 event->world() ? toScriptState(frame, *event->world()) : nullptr;
183 } else if (context->isMainThreadWorkletGlobalScope()) { 184 } else if (context->isMainThreadWorkletGlobalScope()) {
184 frame = toMainThreadWorkletGlobalScope(context)->frame(); 185 frame = toMainThreadWorkletGlobalScope(context)->frame();
185 if (!frame) 186 if (!frame)
186 return; 187 return;
187 scriptState = toMainThreadWorkletGlobalScope(context) 188 scriptState = toMainThreadWorkletGlobalScope(context)
188 ->scriptController() 189 ->scriptController()
189 ->getScriptState(); 190 ->getScriptState();
190 } else { 191 } else {
191 NOTREACHED(); 192 NOTREACHED();
192 } 193 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 context, nodes, index++, 464 context, nodes, index++,
464 ToV8(node, info.Holder(), info.GetIsolate())) 465 ToV8(node, info.Holder(), info.GetIsolate()))
465 .FromMaybe(false)) 466 .FromMaybe(false))
466 return; 467 return;
467 } 468 }
468 info.GetReturnValue().Set(nodes); 469 info.GetReturnValue().Set(nodes);
469 } 470 }
470 } 471 }
471 472
472 } // namespace blink 473 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp ('k') | third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698