| 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 27 matching lines...) Expand all Loading... |
| 38 #include "bindings/core/v8/V8Window.h" | 38 #include "bindings/core/v8/V8Window.h" |
| 39 #include "core/dom/ContainerNode.h" | 39 #include "core/dom/ContainerNode.h" |
| 40 #include "core/dom/Document.h" | 40 #include "core/dom/Document.h" |
| 41 #include "core/dom/Element.h" | 41 #include "core/dom/Element.h" |
| 42 #include "core/dom/ExecutionContext.h" | 42 #include "core/dom/ExecutionContext.h" |
| 43 #include "core/dom/StaticNodeList.h" | 43 #include "core/dom/StaticNodeList.h" |
| 44 #include "core/frame/FrameConsole.h" | 44 #include "core/frame/FrameConsole.h" |
| 45 #include "core/frame/FrameHost.h" | 45 #include "core/frame/FrameHost.h" |
| 46 #include "core/frame/LocalDOMWindow.h" | 46 #include "core/frame/LocalDOMWindow.h" |
| 47 #include "core/frame/LocalFrame.h" | 47 #include "core/frame/LocalFrame.h" |
| 48 #include "core/frame/Settings.h" |
| 48 #include "core/frame/UseCounter.h" | 49 #include "core/frame/UseCounter.h" |
| 49 #include "core/inspector/ConsoleMessage.h" | 50 #include "core/inspector/ConsoleMessage.h" |
| 50 #include "core/inspector/ConsoleMessageStorage.h" | 51 #include "core/inspector/ConsoleMessageStorage.h" |
| 51 #include "core/inspector/IdentifiersFactory.h" | 52 #include "core/inspector/IdentifiersFactory.h" |
| 52 #include "core/inspector/InspectedFrames.h" | 53 #include "core/inspector/InspectedFrames.h" |
| 53 #include "core/inspector/InspectorTaskRunner.h" | 54 #include "core/inspector/InspectorTaskRunner.h" |
| 54 #include "core/timing/MemoryInfo.h" | 55 #include "core/timing/MemoryInfo.h" |
| 55 #include "core/workers/MainThreadWorkletGlobalScope.h" | 56 #include "core/workers/MainThreadWorkletGlobalScope.h" |
| 56 #include "core/xml/XPathEvaluator.h" | 57 #include "core/xml/XPathEvaluator.h" |
| 57 #include "core/xml/XPathResult.h" | 58 #include "core/xml/XPathResult.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 213 } |
| 213 | 214 |
| 214 void MainThreadDebugger::unmuteWarningsAndDeprecations(int contextGroupId) | 215 void MainThreadDebugger::unmuteWarningsAndDeprecations(int contextGroupId) |
| 215 { | 216 { |
| 216 UseCounter::unmuteForInspector(); | 217 UseCounter::unmuteForInspector(); |
| 217 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 218 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 218 if (frame && frame->host()) | 219 if (frame && frame->host()) |
| 219 frame->host()->consoleMessageStorage().unmute(); | 220 frame->host()->consoleMessageStorage().unmute(); |
| 220 } | 221 } |
| 221 | 222 |
| 222 bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c
alling, v8::Local<v8::Context> target) | |
| 223 { | |
| 224 return BindingSecurity::shouldAllowAccessTo(m_isolate, calling, target, DoNo
tReportSecurityError); | |
| 225 } | |
| 226 | |
| 227 v8::Local<v8::Context> MainThreadDebugger::ensureDefaultContextInGroup(int conte
xtGroupId) | 223 v8::Local<v8::Context> MainThreadDebugger::ensureDefaultContextInGroup(int conte
xtGroupId) |
| 228 { | 224 { |
| 229 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 225 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 230 ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullpt
r; | 226 ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullpt
r; |
| 231 return scriptState ? scriptState->context() : v8::Local<v8::Context>(); | 227 return scriptState ? scriptState->context() : v8::Local<v8::Context>(); |
| 232 } | 228 } |
| 233 | 229 |
| 230 void MainThreadDebugger::beginEnsureAllContextsInGroup(int contextGroupId) |
| 231 { |
| 232 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 233 frame->settings()->setForceMainWorldInitialization(true); |
| 234 } |
| 235 |
| 236 void MainThreadDebugger::endEnsureAllContextsInGroup(int contextGroupId) |
| 237 { |
| 238 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 239 frame->settings()->setForceMainWorldInitialization(false); |
| 240 } |
| 241 |
| 234 void MainThreadDebugger::consoleAPIMessage(int contextGroupId, MessageLevel leve
l, const String16& message, const String16& url, unsigned lineNumber, unsigned c
olumnNumber, V8StackTrace* stackTrace) | 242 void MainThreadDebugger::consoleAPIMessage(int contextGroupId, MessageLevel leve
l, const String16& message, const String16& url, unsigned lineNumber, unsigned c
olumnNumber, V8StackTrace* stackTrace) |
| 235 { | 243 { |
| 236 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 244 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 237 if (!frame) | 245 if (!frame) |
| 238 return; | 246 return; |
| 239 // TODO(dgozman): maybe not wrap with ConsoleMessage. | 247 // TODO(dgozman): maybe not wrap with ConsoleMessage. |
| 240 ConsoleMessage* consoleMessage = ConsoleMessage::create(ConsoleAPIMessageSou
rce, level, message, SourceLocation::create(url, lineNumber, columnNumber, stack
Trace ? stackTrace->clone() : nullptr, 0)); | 248 ConsoleMessage* consoleMessage = ConsoleMessage::create(ConsoleAPIMessageSou
rce, level, message, SourceLocation::create(url, lineNumber, columnNumber, stack
Trace ? stackTrace->clone() : nullptr, 0)); |
| 241 frame->console().reportMessageToClient(consoleMessage); | 249 frame->console().reportMessageToClient(consoleMessage); |
| 242 } | 250 } |
| 243 | 251 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 return; | 354 return; |
| 347 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) | 355 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get
Isolate())).FromMaybe(false)) |
| 348 return; | 356 return; |
| 349 } | 357 } |
| 350 info.GetReturnValue().Set(nodes); | 358 info.GetReturnValue().Set(nodes); |
| 351 } | 359 } |
| 352 exceptionState.throwIfNeeded(); | 360 exceptionState.throwIfNeeded(); |
| 353 } | 361 } |
| 354 | 362 |
| 355 } // namespace blink | 363 } // namespace blink |
| OLD | NEW |