| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 s_instance = nullptr; | 90 s_instance = nullptr; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void MainThreadDebugger::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> clie
ntMessageLoop) | 93 void MainThreadDebugger::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> clie
ntMessageLoop) |
| 94 { | 94 { |
| 95 ASSERT(!m_clientMessageLoop); | 95 ASSERT(!m_clientMessageLoop); |
| 96 ASSERT(clientMessageLoop); | 96 ASSERT(clientMessageLoop); |
| 97 m_clientMessageLoop = std::move(clientMessageLoop); | 97 m_clientMessageLoop = std::move(clientMessageLoop); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MainThreadDebugger::didClearContextsForFrame(LocalFrame* frame) |
| 101 { |
| 102 DCHECK(isMainThread()); |
| 103 if (frame->localFrameRoot() == frame) |
| 104 debugger()->resetContextGroup(contextGroupId(frame)); |
| 105 } |
| 106 |
| 100 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) | 107 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) |
| 101 { | 108 { |
| 102 ASSERT(isMainThread()); | 109 ASSERT(isMainThread()); |
| 103 v8::HandleScope handles(scriptState->isolate()); | 110 v8::HandleScope handles(scriptState->isolate()); |
| 104 DOMWrapperWorld& world = scriptState->world(); | 111 DOMWrapperWorld& world = scriptState->world(); |
| 105 if (frame->localFrameRoot() == frame && world.isMainWorld()) | |
| 106 debugger()->resetContextGroup(contextGroupId(frame)); | |
| 107 debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGrou
pId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIs
olatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory:
:frameId(frame), scriptState->getExecutionContext()->isDocument())); | 112 debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGrou
pId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIs
olatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory:
:frameId(frame), scriptState->getExecutionContext()->isDocument())); |
| 108 } | 113 } |
| 109 | 114 |
| 110 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) | 115 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) |
| 111 { | 116 { |
| 112 v8::HandleScope handles(scriptState->isolate()); | 117 v8::HandleScope handles(scriptState->isolate()); |
| 113 debugger()->contextDestroyed(scriptState->context()); | 118 debugger()->contextDestroyed(scriptState->context()); |
| 114 } | 119 } |
| 115 | 120 |
| 116 int MainThreadDebugger::contextGroupId(LocalFrame* frame) | 121 int MainThreadDebugger::contextGroupId(LocalFrame* frame) |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 233 |
| 229 v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v
8::Local<v8::Context> context) | 234 v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v
8::Local<v8::Context> context) |
| 230 { | 235 { |
| 231 ExecutionContext* executionContext = toExecutionContext(context); | 236 ExecutionContext* executionContext = toExecutionContext(context); |
| 232 ASSERT_UNUSED(executionContext, executionContext); | 237 ASSERT_UNUSED(executionContext, executionContext); |
| 233 ASSERT(executionContext->isDocument()); | 238 ASSERT(executionContext->isDocument()); |
| 234 return toV8(MemoryInfo::create(), context->Global(), isolate); | 239 return toV8(MemoryInfo::create(), context->Global(), isolate); |
| 235 } | 240 } |
| 236 | 241 |
| 237 } // namespace blink | 242 } // namespace blink |
| OLD | NEW |