| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 s_instance = nullptr; | 93 s_instance = nullptr; |
| 94 } | 94 } |
| 95 | 95 |
| 96 void MainThreadDebugger::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> clie
ntMessageLoop) | 96 void MainThreadDebugger::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> clie
ntMessageLoop) |
| 97 { | 97 { |
| 98 ASSERT(!m_clientMessageLoop); | 98 ASSERT(!m_clientMessageLoop); |
| 99 ASSERT(clientMessageLoop); | 99 ASSERT(clientMessageLoop); |
| 100 m_clientMessageLoop = std::move(clientMessageLoop); | 100 m_clientMessageLoop = std::move(clientMessageLoop); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void MainThreadDebugger::didClearContextsForFrame(LocalFrame* frame) |
| 104 { |
| 105 DCHECK(isMainThread()); |
| 106 if (frame->localFrameRoot() == frame) |
| 107 debugger()->resetContextGroup(contextGroupId(frame)); |
| 108 } |
| 109 |
| 103 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) | 110 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) |
| 104 { | 111 { |
| 105 ASSERT(isMainThread()); | 112 ASSERT(isMainThread()); |
| 106 v8::HandleScope handles(scriptState->isolate()); | 113 v8::HandleScope handles(scriptState->isolate()); |
| 107 DOMWrapperWorld& world = scriptState->world(); | 114 DOMWrapperWorld& world = scriptState->world(); |
| 108 if (frame->localFrameRoot() == frame && world.isMainWorld()) | |
| 109 debugger()->resetContextGroup(contextGroupId(frame)); | |
| 110 debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGrou
pId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIs
olatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory:
:frameId(frame), scriptState->getExecutionContext()->isDocument())); | 115 debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGrou
pId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIs
olatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory:
:frameId(frame), scriptState->getExecutionContext()->isDocument())); |
| 111 } | 116 } |
| 112 | 117 |
| 113 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) | 118 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) |
| 114 { | 119 { |
| 115 v8::HandleScope handles(scriptState->isolate()); | 120 v8::HandleScope handles(scriptState->isolate()); |
| 116 debugger()->contextDestroyed(scriptState->context()); | 121 debugger()->contextDestroyed(scriptState->context()); |
| 117 } | 122 } |
| 118 | 123 |
| 119 int MainThreadDebugger::contextGroupId(LocalFrame* frame) | 124 int MainThreadDebugger::contextGroupId(LocalFrame* frame) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 return; | 339 return; |
| 335 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) | 340 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) |
| 336 return; | 341 return; |
| 337 } | 342 } |
| 338 info.GetReturnValue().Set(nodes); | 343 info.GetReturnValue().Set(nodes); |
| 339 } | 344 } |
| 340 exceptionState.throwIfNeeded(); | 345 exceptionState.throwIfNeeded(); |
| 341 } | 346 } |
| 342 | 347 |
| 343 } // namespace blink | 348 } // namespace blink |
| OLD | NEW |