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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made InspectorBaseAgent RefCounted Created 7 years, 6 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
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 String InspectorDOMAgent::toErrorString(const ExceptionCode& ec) 215 String InspectorDOMAgent::toErrorString(const ExceptionCode& ec)
216 { 216 {
217 if (ec) { 217 if (ec) {
218 ExceptionCodeDescription description(ec); 218 ExceptionCodeDescription description(ec);
219 return description.name; 219 return description.name;
220 } 220 }
221 return ""; 221 return "";
222 } 222 }
223 223
224 InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, I nspectorPageAgent* pageAgent, InspectorCompositeState* inspectorState, InjectedS criptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client) 224 PassRefPtr<InspectorDOMAgent> InspectorDOMAgent::create(InstrumentingAgents* ins trumentingAgents, InspectorState* inspectorState, PassRefPtr<InspectorPageAgent> pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* over lay, InspectorClient* client)
225 : InspectorBaseAgent<InspectorDOMAgent>("DOM", instrumentingAgents, inspecto rState) 225 {
226 return adoptRef(new InspectorDOMAgent(instrumentingAgents, inspectorState, p ageAgent, injectedScriptManager, overlay, client));
227 }
228
229 InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, I nspectorState* inspectorState, PassRefPtr<InspectorPageAgent> pageAgent, Injecte dScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClien t* client)
230 : InspectorBaseAgent(instrumentingAgents, inspectorState)
226 , m_pageAgent(pageAgent) 231 , m_pageAgent(pageAgent)
227 , m_injectedScriptManager(injectedScriptManager) 232 , m_injectedScriptManager(injectedScriptManager)
228 , m_overlay(overlay) 233 , m_overlay(overlay)
229 , m_client(client) 234 , m_client(client)
230 , m_frontend(0) 235 , m_frontend(0)
231 , m_domListener(0) 236 , m_domListener(0)
232 , m_lastNodeId(1) 237 , m_lastNodeId(1)
233 , m_lastBackendNodeId(-1) 238 , m_lastBackendNodeId(-1)
234 , m_searchingForNode(false) 239 , m_searchingForNode(false)
235 , m_suppressAttributeModifiedEvent(false) 240 , m_suppressAttributeModifiedEvent(false)
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 if (!frame) 1829 if (!frame)
1825 return 0; 1830 return 0;
1826 1831
1827 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m ainWorldScriptState(frame)); 1832 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m ainWorldScriptState(frame));
1828 if (injectedScript.hasNoValue()) 1833 if (injectedScript.hasNoValue())
1829 return 0; 1834 return 0;
1830 1835
1831 return injectedScript.wrapNode(node, objectGroup); 1836 return injectedScript.wrapNode(node, objectGroup);
1832 } 1837 }
1833 1838
1839 InspectorDOMController::InspectorDOMController(InstrumentingAgents* instrumentin gAgents, InspectorCompositeState* compositeState, InspectorPageController* pageC ontroller, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overl ay, InspectorClient* client)
1840 : InspectorBaseController<InspectorDOMController, InspectorDOMAgent>("DOM", instrumentingAgents, compositeState)
1841 {
1842 setAgent(InspectorDOMAgent::create(m_instrumentingAgents, m_state, pageContr oller->getAgent(), injectedScriptManager, overlay, client));
1843 }
1844
1834 } // namespace WebCore 1845 } // namespace WebCore
1835 1846
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698