OLD | NEW |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "core/inspector/ConsoleMessage.h" | 54 #include "core/inspector/ConsoleMessage.h" |
55 #include "core/inspector/ConsoleMessageStorage.h" | 55 #include "core/inspector/ConsoleMessageStorage.h" |
56 #include "core/inspector/IdentifiersFactory.h" | 56 #include "core/inspector/IdentifiersFactory.h" |
57 #include "core/inspector/InspectedFrames.h" | 57 #include "core/inspector/InspectedFrames.h" |
58 #include "core/inspector/InspectorTaskRunner.h" | 58 #include "core/inspector/InspectorTaskRunner.h" |
59 #include "core/timing/MemoryInfo.h" | 59 #include "core/timing/MemoryInfo.h" |
60 #include "core/workers/MainThreadWorkletGlobalScope.h" | 60 #include "core/workers/MainThreadWorkletGlobalScope.h" |
61 #include "core/xml/XPathEvaluator.h" | 61 #include "core/xml/XPathEvaluator.h" |
62 #include "core/xml/XPathResult.h" | 62 #include "core/xml/XPathResult.h" |
63 #include "platform/UserGestureIndicator.h" | 63 #include "platform/UserGestureIndicator.h" |
| 64 #include "platform/inspector_protocol/Values.h" |
64 #include "platform/v8_inspector/public/V8Inspector.h" | 65 #include "platform/v8_inspector/public/V8Inspector.h" |
65 #include "wtf/PtrUtil.h" | 66 #include "wtf/PtrUtil.h" |
66 #include "wtf/ThreadingPrimitives.h" | 67 #include "wtf/ThreadingPrimitives.h" |
67 #include <memory> | 68 #include <memory> |
68 | 69 |
69 namespace blink { | 70 namespace blink { |
70 | 71 |
71 namespace { | 72 namespace { |
72 | 73 |
73 int frameId(LocalFrame* frame) | 74 int frameId(LocalFrame* frame) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 DCHECK(isMainThread()); | 139 DCHECK(isMainThread()); |
139 if (frame->localFrameRoot() == frame) | 140 if (frame->localFrameRoot() == frame) |
140 v8Inspector()->resetContextGroup(contextGroupId(frame)); | 141 v8Inspector()->resetContextGroup(contextGroupId(frame)); |
141 } | 142 } |
142 | 143 |
143 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) | 144 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) |
144 { | 145 { |
145 ASSERT(isMainThread()); | 146 ASSERT(isMainThread()); |
146 v8::HandleScope handles(scriptState->isolate()); | 147 v8::HandleScope handles(scriptState->isolate()); |
147 DOMWrapperWorld& world = scriptState->world(); | 148 DOMWrapperWorld& world = scriptState->world(); |
148 v8Inspector()->contextCreated(V8ContextInfo(scriptState->context(), contextG
roupId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.i
sIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFacto
ry::frameId(frame), scriptState->getExecutionContext()->isDocument())); | 149 std::unique_ptr<protocol::DictionaryValue> auxData = protocol::DictionaryVal
ue::create(); |
| 150 auxData->setBoolean("isDefault", world.isMainWorld()); |
| 151 auxData->setString("frameId", IdentifiersFactory::frameId(frame)); |
| 152 V8ContextInfo contextInfo(scriptState->context(), contextGroupId(frame), wor
ld.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : ""); |
| 153 if (origin) |
| 154 contextInfo.origin = origin->toRawString(); |
| 155 contextInfo.auxData = auxData->toJSONString(); |
| 156 contextInfo.hasMemoryOnConsole = scriptState->getExecutionContext()->isDocum
ent(); |
| 157 v8Inspector()->contextCreated(contextInfo); |
149 } | 158 } |
150 | 159 |
151 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) | 160 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) |
152 { | 161 { |
153 v8::HandleScope handles(scriptState->isolate()); | 162 v8::HandleScope handles(scriptState->isolate()); |
154 v8Inspector()->contextDestroyed(scriptState->context()); | 163 v8Inspector()->contextDestroyed(scriptState->context()); |
155 } | 164 } |
156 | 165 |
157 void MainThreadDebugger::exceptionThrown(ExecutionContext* context, ErrorEvent*
event) | 166 void MainThreadDebugger::exceptionThrown(ExecutionContext* context, ErrorEvent*
event) |
158 { | 167 { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return; | 399 return; |
391 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) | 400 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) |
392 return; | 401 return; |
393 } | 402 } |
394 info.GetReturnValue().Set(nodes); | 403 info.GetReturnValue().Set(nodes); |
395 } | 404 } |
396 exceptionState.throwIfNeeded(); | 405 exceptionState.throwIfNeeded(); |
397 } | 406 } |
398 | 407 |
399 } // namespace blink | 408 } // namespace blink |
OLD | NEW |