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 26 matching lines...) Expand all Loading... |
37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
39 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class LocalFrame; | 43 class LocalFrame; |
44 | 44 |
45 using protocol::ErrorString; | 45 using protocol::ErrorString; |
46 using protocol::Maybe; | 46 using protocol::Maybe; |
| 47 using protocol::Response; |
47 | 48 |
48 class CORE_EXPORT InspectorAgent | 49 class CORE_EXPORT InspectorAgent |
49 : public GarbageCollectedFinalized<InspectorAgent> { | 50 : public GarbageCollectedFinalized<InspectorAgent> { |
50 public: | 51 public: |
51 InspectorAgent() {} | 52 InspectorAgent() {} |
52 virtual ~InspectorAgent() {} | 53 virtual ~InspectorAgent() {} |
53 DEFINE_INLINE_VIRTUAL_TRACE() {} | 54 DEFINE_INLINE_VIRTUAL_TRACE() {} |
54 | 55 |
55 virtual void restore() {} | 56 virtual void restore() {} |
56 virtual void didCommitLoadForLocalFrame(LocalFrame*) {} | 57 virtual void didCommitLoadForLocalFrame(LocalFrame*) {} |
(...skipping 21 matching lines...) Expand all Loading... |
78 | 79 |
79 m_state = state->getObject(DomainMetainfo::domainName); | 80 m_state = state->getObject(DomainMetainfo::domainName); |
80 if (!m_state) { | 81 if (!m_state) { |
81 std::unique_ptr<protocol::DictionaryValue> newState = | 82 std::unique_ptr<protocol::DictionaryValue> newState = |
82 protocol::DictionaryValue::create(); | 83 protocol::DictionaryValue::create(); |
83 m_state = newState.get(); | 84 m_state = newState.get(); |
84 state->setObject(DomainMetainfo::domainName, std::move(newState)); | 85 state->setObject(DomainMetainfo::domainName, std::move(newState)); |
85 } | 86 } |
86 } | 87 } |
87 | 88 |
88 void disable(ErrorString*) override {} | |
89 | |
90 void dispose() override { | 89 void dispose() override { |
91 ErrorString error; | 90 DomainMetainfo::BackendClass::disableMe(this); |
92 disable(&error); | |
93 m_frontend.reset(); | 91 m_frontend.reset(); |
94 m_state = nullptr; | 92 m_state = nullptr; |
95 m_instrumentingAgents = nullptr; | 93 m_instrumentingAgents = nullptr; |
96 } | 94 } |
97 | 95 |
98 DEFINE_INLINE_VIRTUAL_TRACE() { | 96 DEFINE_INLINE_VIRTUAL_TRACE() { |
99 visitor->trace(m_instrumentingAgents); | 97 visitor->trace(m_instrumentingAgents); |
100 InspectorAgent::trace(visitor); | 98 InspectorAgent::trace(visitor); |
101 } | 99 } |
102 | 100 |
103 protected: | 101 protected: |
104 InspectorBaseAgent() {} | 102 InspectorBaseAgent() {} |
105 | 103 |
106 typename DomainMetainfo::FrontendClass* frontend() const { | 104 typename DomainMetainfo::FrontendClass* frontend() const { |
107 return m_frontend.get(); | 105 return m_frontend.get(); |
108 } | 106 } |
109 Member<InstrumentingAgents> m_instrumentingAgents; | 107 Member<InstrumentingAgents> m_instrumentingAgents; |
110 protocol::DictionaryValue* m_state; | 108 protocol::DictionaryValue* m_state; |
111 | 109 |
112 private: | 110 private: |
113 std::unique_ptr<typename DomainMetainfo::FrontendClass> m_frontend; | 111 std::unique_ptr<typename DomainMetainfo::FrontendClass> m_frontend; |
114 }; | 112 }; |
115 | 113 |
116 } // namespace blink | 114 } // namespace blink |
117 | 115 |
118 #endif // !defined(InspectorBaseAgent_h) | 116 #endif // !defined(InspectorBaseAgent_h) |
OLD | NEW |