Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: Source/core/inspector/InspectorResolver.cpp

Issue 1118963002: Revert of DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorResolver.h ('k') | Source/core/inspector/InspectorResourceAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698