| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/inspector/PageConsoleAgent.h" | 32 #include "core/inspector/PageConsoleAgent.h" |
| 33 | 33 |
| 34 #include "core/dom/Node.h" | 34 #include "core/dom/Node.h" |
| 35 #include "core/dom/NodeTraversal.h" | 35 #include "core/dom/NodeTraversal.h" |
| 36 #include "core/dom/shadow/ShadowRoot.h" | 36 #include "core/dom/shadow/ShadowRoot.h" |
| 37 #include "core/frame/FrameConsole.h" |
| 37 #include "core/inspector/InjectedScriptHost.h" | 38 #include "core/inspector/InjectedScriptHost.h" |
| 38 #include "core/inspector/InjectedScriptManager.h" | 39 #include "core/inspector/InjectedScriptManager.h" |
| 39 #include "core/inspector/InspectorDOMAgent.h" | 40 #include "core/inspector/InspectorDOMAgent.h" |
| 41 #include "core/page/Page.h" |
| 40 | 42 |
| 41 namespace blink { | 43 namespace blink { |
| 42 | 44 |
| 43 PageConsoleAgent::PageConsoleAgent(InjectedScriptManager* injectedScriptManager,
InspectorDOMAgent* domAgent, InspectorTimelineAgent* timelineAgent, InspectorTr
acingAgent* tracingAgent) | 45 PageConsoleAgent::PageConsoleAgent(InjectedScriptManager* injectedScriptManager,
InspectorDOMAgent* domAgent, InspectorTimelineAgent* timelineAgent, InspectorTr
acingAgent* tracingAgent, Page* page) |
| 44 : InspectorConsoleAgent(timelineAgent, tracingAgent, injectedScriptManager) | 46 : InspectorConsoleAgent(timelineAgent, tracingAgent, injectedScriptManager) |
| 45 , m_inspectorDOMAgent(domAgent) | 47 , m_inspectorDOMAgent(domAgent) |
| 48 , m_page(page) |
| 46 { | 49 { |
| 47 } | 50 } |
| 48 | 51 |
| 49 PageConsoleAgent::~PageConsoleAgent() | 52 PageConsoleAgent::~PageConsoleAgent() |
| 50 { | 53 { |
| 51 #if !ENABLE(OILPAN) | 54 #if !ENABLE(OILPAN) |
| 52 m_inspectorDOMAgent = nullptr; | 55 m_inspectorDOMAgent = nullptr; |
| 53 #endif | 56 #endif |
| 54 } | 57 } |
| 55 | 58 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 86 while (node->isInShadowTree()) { | 89 while (node->isInShadowTree()) { |
| 87 Node& ancestor = NodeTraversal::highestAncestorOrSelf(*node); | 90 Node& ancestor = NodeTraversal::highestAncestorOrSelf(*node); |
| 88 if (!ancestor.isShadowRoot() || toShadowRoot(ancestor).type() == ShadowR
oot::AuthorShadowRoot) | 91 if (!ancestor.isShadowRoot() || toShadowRoot(ancestor).type() == ShadowR
oot::AuthorShadowRoot) |
| 89 break; | 92 break; |
| 90 // User agent shadow root, keep climbing up. | 93 // User agent shadow root, keep climbing up. |
| 91 node = toShadowRoot(ancestor).host(); | 94 node = toShadowRoot(ancestor).host(); |
| 92 } | 95 } |
| 93 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableNode(node))); | 96 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableNode(node))); |
| 94 } | 97 } |
| 95 | 98 |
| 99 ConsoleMessageStorage* PageConsoleAgent::messageStorage() |
| 100 { |
| 101 Frame* frame = m_page->mainFrame(); |
| 102 if (frame->isLocalFrame()) |
| 103 return toLocalFrame(frame)->console().messageStorage(); |
| 104 return nullptr; |
| 105 } |
| 106 |
| 96 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |