| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "core/inspector/InspectorResolver.h" | |
| 7 | |
| 8 #include "core/dom/DOMNodeIds.h" | |
| 9 #include "core/dom/Document.h" | |
| 10 #include "core/dom/Node.h" | |
| 11 #include "core/frame/LocalFrame.h" | |
| 12 #include "core/inspector/InspectorIdentifiers.h" | |
| 13 #include "core/loader/DocumentLoader.h" | |
| 14 #include "wtf/text/WTFString.h" | |
| 15 | |
| 16 namespace blink { | |
| 17 | |
| 18 namespace InspectorResolver { | |
| 19 | |
| 20 Node* resolveNode(LocalFrame* inspectedFrame, int identifier) | |
| 21 { | |
| 22 Node* node = DOMNodeIds::nodeForId(identifier); | |
| 23 LocalFrame* frame = node ? node->document().frame() : nullptr; | |
| 24 if (!frame || frame->instrumentingAgents() != inspectedFrame->instrumentingA
gents()) | |
| 25 return nullptr; | |
| 26 return node; | |
| 27 } | |
| 28 | |
| 29 LocalFrame* resolveFrame(LocalFrame* inspectedFrame, const String& identifier) | |
| 30 { | |
| 31 LocalFrame* frame = InspectorIdentifiers<LocalFrame>::lookup(identifier); | |
| 32 if (!frame || frame->instrumentingAgents() != inspectedFrame->instrumentingA
gents()) | |
| 33 return nullptr; | |
| 34 return frame; | |
| 35 } | |
| 36 | |
| 37 } // namespace InspectorResolver | |
| 38 | |
| 39 } // namespace blink | |
| OLD | NEW |