| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) | 143 void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ame, SecurityOrigin* origin) |
| 144 { | 144 { |
| 145 ASSERT(isMainThread()); | 145 ASSERT(isMainThread()); |
| 146 v8::HandleScope handles(scriptState->isolate()); | 146 v8::HandleScope handles(scriptState->isolate()); |
| 147 DOMWrapperWorld& world = scriptState->world(); | 147 DOMWrapperWorld& world = scriptState->world(); |
| 148 std::unique_ptr<protocol::DictionaryValue> auxData = protocol::DictionaryVal
ue::create(); | 148 std::unique_ptr<protocol::DictionaryValue> auxData = protocol::DictionaryVal
ue::create(); |
| 149 auxData->setBoolean("isDefault", world.isMainWorld()); | 149 auxData->setBoolean("isDefault", world.isMainWorld()); |
| 150 auxData->setString("frameId", IdentifiersFactory::frameId(frame)); | 150 auxData->setString("frameId", IdentifiersFactory::frameId(frame)); |
| 151 V8ContextInfo contextInfo(scriptState->context(), contextGroupId(frame), wor
ld.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : ""); | 151 v8_inspector::V8ContextInfo contextInfo(scriptState->context(), contextGroup
Id(frame), world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : ""
); |
| 152 if (origin) | 152 if (origin) |
| 153 contextInfo.origin = origin->toRawString(); | 153 contextInfo.origin = origin->toRawString(); |
| 154 contextInfo.auxData = auxData->toJSONString(); | 154 contextInfo.auxData = auxData->toJSONString(); |
| 155 contextInfo.hasMemoryOnConsole = scriptState->getExecutionContext()->isDocum
ent(); | 155 contextInfo.hasMemoryOnConsole = scriptState->getExecutionContext()->isDocum
ent(); |
| 156 v8Inspector()->contextCreated(contextInfo); | 156 v8Inspector()->contextCreated(contextInfo); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) | 159 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) |
| 160 { | 160 { |
| 161 v8::HandleScope handles(scriptState->isolate()); | 161 v8::HandleScope handles(scriptState->isolate()); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return frame->script().canExecuteScripts(NotAboutToExecuteScript); | 280 return frame->script().canExecuteScripts(NotAboutToExecuteScript); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void MainThreadDebugger::resumeStartup(int contextGroupId) | 283 void MainThreadDebugger::resumeStartup(int contextGroupId) |
| 284 { | 284 { |
| 285 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 285 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 286 if (m_clientMessageLoop) | 286 if (m_clientMessageLoop) |
| 287 m_clientMessageLoop->resumeStartup(frame); | 287 m_clientMessageLoop->resumeStartup(frame); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void MainThreadDebugger::consoleAPIMessage(int contextGroupId, V8ConsoleAPIType
type, const String16& message, const String16& url, unsigned lineNumber, unsigne
d columnNumber, V8StackTrace* stackTrace) | 290 void MainThreadDebugger::consoleAPIMessage(int contextGroupId, v8_inspector::V8C
onsoleAPIType type, const String16& message, const String16& url, unsigned lineN
umber, unsigned columnNumber, v8_inspector::V8StackTrace* stackTrace) |
| 291 { | 291 { |
| 292 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 292 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 293 if (!frame) | 293 if (!frame) |
| 294 return; | 294 return; |
| 295 if (type == V8ConsoleAPIType::kClear && frame->host()) | 295 if (type == v8_inspector::V8ConsoleAPIType::kClear && frame->host()) |
| 296 frame->host()->consoleMessageStorage().clear(); | 296 frame->host()->consoleMessageStorage().clear(); |
| 297 std::unique_ptr<SourceLocation> location = SourceLocation::create(url, lineN
umber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0); | 297 std::unique_ptr<SourceLocation> location = SourceLocation::create(url, lineN
umber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0); |
| 298 frame->console().reportMessageToClient(ConsoleAPIMessageSource, consoleAPITy
peToMessageLevel(type), message, location.get()); | 298 frame->console().reportMessageToClient(ConsoleAPIMessageSource, consoleAPITy
peToMessageLevel(type), message, location.get()); |
| 299 } | 299 } |
| 300 | 300 |
| 301 v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v
8::Local<v8::Context> context) | 301 v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v
8::Local<v8::Context> context) |
| 302 { | 302 { |
| 303 ExecutionContext* executionContext = toExecutionContext(context); | 303 ExecutionContext* executionContext = toExecutionContext(context); |
| 304 ASSERT_UNUSED(executionContext, executionContext); | 304 ASSERT_UNUSED(executionContext, executionContext); |
| 305 ASSERT(executionContext->isDocument()); | 305 ASSERT(executionContext->isDocument()); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 return; | 403 return; |
| 404 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) | 404 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) |
| 405 return; | 405 return; |
| 406 } | 406 } |
| 407 info.GetReturnValue().Set(nodes); | 407 info.GetReturnValue().Set(nodes); |
| 408 } | 408 } |
| 409 exceptionState.throwIfNeeded(); | 409 exceptionState.throwIfNeeded(); |
| 410 } | 410 } |
| 411 | 411 |
| 412 } // namespace blink | 412 } // namespace blink |
| OLD | NEW |