| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/InspectorFrontend.h" | 33 #include "core/InspectorFrontend.h" |
| 34 #include "core/inspector/InspectorBaseAgent.h" | 34 #include "core/inspector/InspectorBaseAgent.h" |
| 35 #include "wtf/HashMap.h" | 35 #include "wtf/HashMap.h" |
| 36 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
| 37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class LocalFrame; | 41 class LocalFrame; |
| 42 class InjectedScriptManager; | 42 class InjectedScriptManager; |
| 43 class InspectorController; | |
| 44 class JSONObject; | 43 class JSONObject; |
| 44 class Page; |
| 45 | 45 |
| 46 typedef String ErrorString; | 46 typedef String ErrorString; |
| 47 | 47 |
| 48 class InspectorInspectorAgent final : public InspectorBaseAgent<InspectorInspect
orAgent>, public InspectorBackendDispatcher::InspectorCommandHandler { | 48 class InspectorInspectorAgent final : public InspectorBaseAgent<InspectorInspect
orAgent>, public InspectorBackendDispatcher::InspectorCommandHandler { |
| 49 WTF_MAKE_NONCOPYABLE(InspectorInspectorAgent); | 49 WTF_MAKE_NONCOPYABLE(InspectorInspectorAgent); |
| 50 public: | 50 public: |
| 51 static PassOwnPtrWillBeRawPtr<InspectorInspectorAgent> create(InspectorContr
oller* inspectorController, InjectedScriptManager* injectedScriptManager) | 51 static PassOwnPtrWillBeRawPtr<InspectorInspectorAgent> create(Page* page, In
jectedScriptManager* injectedScriptManager) |
| 52 { | 52 { |
| 53 return adoptPtrWillBeNoop(new InspectorInspectorAgent(inspectorControlle
r, injectedScriptManager)); | 53 return adoptPtrWillBeNoop(new InspectorInspectorAgent(page, injectedScri
ptManager)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual ~InspectorInspectorAgent(); | 56 virtual ~InspectorInspectorAgent(); |
| 57 virtual void trace(Visitor*) override; | 57 virtual void trace(Visitor*) override; |
| 58 | 58 |
| 59 // Inspector front-end API. | 59 // Inspector front-end API. |
| 60 virtual void enable(ErrorString*) override; | 60 virtual void enable(ErrorString*) override; |
| 61 virtual void disable(ErrorString*) override; | 61 virtual void disable(ErrorString*) override; |
| 62 virtual void reset(ErrorString*) override; | 62 virtual void reset(ErrorString*) override; |
| 63 | 63 |
| 64 virtual void init() override; | 64 virtual void init() override; |
| 65 virtual void setFrontend(InspectorFrontend*) override; | 65 virtual void setFrontend(InspectorFrontend*) override; |
| 66 virtual void clearFrontend() override; | 66 virtual void clearFrontend() override; |
| 67 | 67 |
| 68 void didClearDocumentOfWindowObject(LocalFrame*); | 68 void didClearDocumentOfWindowObject(LocalFrame*); |
| 69 | 69 |
| 70 void domContentLoadedEventFired(LocalFrame*); | 70 void domContentLoadedEventFired(LocalFrame*); |
| 71 | 71 |
| 72 bool hasFrontend() const { return m_frontend; } | 72 bool hasFrontend() const { return m_frontend; } |
| 73 | 73 |
| 74 // Generic code called from custom implementations. | 74 // Generic code called from custom implementations. |
| 75 void evaluateForTestInFrontend(long testCallId, const String& script); | 75 void evaluateForTestInFrontend(long testCallId, const String& script); |
| 76 | 76 |
| 77 void setInjectedScriptForOrigin(const String& origin, const String& source); | 77 void setInjectedScriptForOrigin(const String& origin, const String& source); |
| 78 | 78 |
| 79 void inspect(PassRefPtr<TypeBuilder::Runtime::RemoteObject> objectToInspect,
PassRefPtr<JSONObject> hints); | 79 void inspect(PassRefPtr<TypeBuilder::Runtime::RemoteObject> objectToInspect,
PassRefPtr<JSONObject> hints); |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 InspectorInspectorAgent(InspectorController*, InjectedScriptManager*); | 82 InspectorInspectorAgent(Page*, InjectedScriptManager*); |
| 83 | 83 |
| 84 RawPtrWillBeMember<InspectorController> m_inspectorController; | 84 RawPtrWillBeMember<Page> m_inspectedPage; |
| 85 InspectorFrontend::Inspector* m_frontend; | 85 InspectorFrontend::Inspector* m_frontend; |
| 86 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; | 86 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; |
| 87 | 87 |
| 88 Vector<pair<long, String> > m_pendingEvaluateTestCommands; | 88 Vector<pair<long, String> > m_pendingEvaluateTestCommands; |
| 89 pair<RefPtr<TypeBuilder::Runtime::RemoteObject>, RefPtr<JSONObject> > m_pend
ingInspectData; | 89 pair<RefPtr<TypeBuilder::Runtime::RemoteObject>, RefPtr<JSONObject> > m_pend
ingInspectData; |
| 90 typedef HashMap<String, String> InjectedScriptForOriginMap; | 90 typedef HashMap<String, String> InjectedScriptForOriginMap; |
| 91 InjectedScriptForOriginMap m_injectedScriptForOrigin; | 91 InjectedScriptForOriginMap m_injectedScriptForOrigin; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace blink | 94 } // namespace blink |
| 95 | 95 |
| 96 #endif // !defined(InspectorInspectorAgent_h) | 96 #endif // !defined(InspectorInspectorAgent_h) |
| OLD | NEW |