| 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 20 matching lines...) Expand all Loading... |
| 31 #ifndef InspectorRuntimeAgent_h | 31 #ifndef InspectorRuntimeAgent_h |
| 32 #define InspectorRuntimeAgent_h | 32 #define InspectorRuntimeAgent_h |
| 33 | 33 |
| 34 #include "core/InspectorFrontend.h" | 34 #include "core/InspectorFrontend.h" |
| 35 #include "core/inspector/InspectorBaseAgent.h" | 35 #include "core/inspector/InspectorBaseAgent.h" |
| 36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 37 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class EventTarget; |
| 41 class InjectedScript; | 42 class InjectedScript; |
| 42 class InjectedScriptManager; | 43 class InjectedScriptManager; |
| 43 class JSONArray; | 44 class JSONArray; |
| 45 class RegisteredEventListener; |
| 46 class ScriptDebugServer; |
| 44 class ScriptState; | 47 class ScriptState; |
| 45 class ScriptDebugServer; | |
| 46 | 48 |
| 47 typedef String ErrorString; | 49 typedef String ErrorString; |
| 48 | 50 |
| 49 class InspectorRuntimeAgent : public InspectorBaseAgent<InspectorRuntimeAgent, I
nspectorFrontend::Runtime>, public InspectorBackendDispatcher::RuntimeCommandHan
dler { | 51 class InspectorRuntimeAgent : public InspectorBaseAgent<InspectorRuntimeAgent, I
nspectorFrontend::Runtime>, public InspectorBackendDispatcher::RuntimeCommandHan
dler { |
| 50 WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent); | 52 WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent); |
| 51 public: | 53 public: |
| 52 class Client { | 54 class Client { |
| 53 public: | 55 public: |
| 54 virtual ~Client() { } | 56 virtual ~Client() { } |
| 55 | 57 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 77 const String& objectId, | 79 const String& objectId, |
| 78 const String& expression, | 80 const String& expression, |
| 79 const RefPtr<JSONArray>* optionalArguments, | 81 const RefPtr<JSONArray>* optionalArguments, |
| 80 const bool* doNotPauseOnExceptionsAndMuteConsole, | 82 const bool* doNotPauseOnExceptionsAndMuteConsole, |
| 81 const bool* returnByValue, | 83 const bool* returnByValue, |
| 82 const bool* generatePreview, | 84 const bool* generatePreview, |
| 83 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, | 85 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, |
| 84 TypeBuilder::OptOutput<bool>* wasThrown) override final; | 86 TypeBuilder::OptOutput<bool>* wasThrown) override final; |
| 85 virtual void releaseObject(ErrorString*, const String& objectId) override fi
nal; | 87 virtual void releaseObject(ErrorString*, const String& objectId) override fi
nal; |
| 86 virtual void getProperties(ErrorString*, const String& objectId, const bool*
ownProperties, const bool* accessorPropertiesOnly, const bool* generatePreview,
RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor>>& result, R
efPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor>>& int
ernalProperties) override final; | 88 virtual void getProperties(ErrorString*, const String& objectId, const bool*
ownProperties, const bool* accessorPropertiesOnly, const bool* generatePreview,
RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor>>& result, R
efPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor>>& int
ernalProperties) override final; |
| 89 virtual void getEventListeners(ErrorString*, const String& objectId, const S
tring* objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::EventListene
r>>& result) override final; |
| 87 virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) ove
rride final; | 90 virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) ove
rride final; |
| 88 virtual void run(ErrorString*) override; | 91 virtual void run(ErrorString*) override; |
| 89 virtual void isRunRequired(ErrorString*, bool* out_result) override; | 92 virtual void isRunRequired(ErrorString*, bool* out_result) override; |
| 90 virtual void setCustomObjectFormatterEnabled(ErrorString*, bool) override fi
nal; | 93 virtual void setCustomObjectFormatterEnabled(ErrorString*, bool) override fi
nal; |
| 91 | 94 |
| 92 void disable(ErrorString*) override final; | 95 void disable(ErrorString*) override final; |
| 93 void restore() override final; | 96 void restore() override final; |
| 94 | 97 |
| 95 protected: | 98 protected: |
| 96 InspectorRuntimeAgent(InjectedScriptManager*, ScriptDebugServer*, Client*); | 99 InspectorRuntimeAgent(InjectedScriptManager*, ScriptDebugServer*, Client*); |
| 97 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; | 100 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; |
| 98 | 101 |
| 99 virtual void muteConsole() = 0; | 102 virtual void muteConsole() = 0; |
| 100 virtual void unmuteConsole() = 0; | 103 virtual void unmuteConsole() = 0; |
| 101 | 104 |
| 102 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } | 105 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } |
| 103 void addExecutionContextToFrontend(ScriptState*, bool isPageContext, const S
tring& origin, const String& frameId); | 106 void addExecutionContextToFrontend(ScriptState*, bool isPageContext, const S
tring& origin, const String& frameId); |
| 104 | 107 |
| 105 bool m_enabled; | 108 bool m_enabled; |
| 106 | 109 |
| 107 typedef HashMap<RefPtr<ScriptState>, int> ScriptStateToId; | 110 typedef HashMap<RefPtr<ScriptState>, int> ScriptStateToId; |
| 108 ScriptStateToId m_scriptStateToId; | 111 ScriptStateToId m_scriptStateToId; |
| 109 | 112 |
| 110 private: | 113 private: |
| 114 PassRefPtr<TypeBuilder::Runtime::EventListener> buildObjectForEventListener(
const RegisteredEventListener&, const AtomicString& eventType, EventTarget*, con
st String* objectGroupId); |
| 115 |
| 111 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; | 116 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; |
| 112 ScriptDebugServer* m_scriptDebugServer; | 117 ScriptDebugServer* m_scriptDebugServer; |
| 113 Client* m_client; | 118 Client* m_client; |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 } // namespace blink | 121 } // namespace blink |
| 117 | 122 |
| 118 #endif // InspectorRuntimeAgent_h | 123 #endif // InspectorRuntimeAgent_h |
| OLD | NEW |