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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; | 95 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
96 RawPtrWillBeMember<InspectorCompositeState> m_inspectorState; | 96 RawPtrWillBeMember<InspectorCompositeState> m_inspectorState; |
97 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; | 97 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; |
98 }; | 98 }; |
99 | 99 |
100 template<typename AgentClass, typename FrontendClass> | 100 template<typename AgentClass, typename FrontendClass> |
101 class InspectorBaseAgent : public InspectorAgent { | 101 class InspectorBaseAgent : public InspectorAgent { |
102 public: | 102 public: |
103 ~InspectorBaseAgent() override { } | 103 ~InspectorBaseAgent() override { } |
104 | 104 |
105 void setFrontend(InspectorFrontend* frontend) final | 105 void setFrontend(InspectorFrontend* frontend) override |
106 { | 106 { |
107 ASSERT(!m_frontend); | 107 ASSERT(!m_frontend); |
108 m_frontend = FrontendClass::from(frontend); | 108 m_frontend = FrontendClass::from(frontend); |
109 } | 109 } |
110 | 110 |
111 void clearFrontend() final | 111 void clearFrontend() override |
112 { | 112 { |
113 ErrorString error; | 113 ErrorString error; |
114 disable(&error); | 114 disable(&error); |
115 ASSERT(m_frontend); | 115 ASSERT(m_frontend); |
116 m_frontend = nullptr; | 116 m_frontend = nullptr; |
117 } | 117 } |
118 | 118 |
119 void registerInDispatcher(InspectorBackendDispatcher* dispatcher) final | 119 void registerInDispatcher(InspectorBackendDispatcher* dispatcher) final |
120 { | 120 { |
121 dispatcher->registerAgent(static_cast<AgentClass*>(this)); | 121 dispatcher->registerAgent(static_cast<AgentClass*>(this)); |
(...skipping 13 matching lines...) Expand all Loading... |
135 }; | 135 }; |
136 | 136 |
137 inline bool asBool(const bool* const b) | 137 inline bool asBool(const bool* const b) |
138 { | 138 { |
139 return b ? *b : false; | 139 return b ? *b : false; |
140 } | 140 } |
141 | 141 |
142 } // namespace blink | 142 } // namespace blink |
143 | 143 |
144 #endif // !defined(InspectorBaseAgent_h) | 144 #endif // !defined(InspectorBaseAgent_h) |
OLD | NEW |