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

Side by Side Diff: Source/core/inspector/PageDebuggerAgent.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) 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 23 matching lines...) Expand all
34 #include "bindings/v8/DOMWrapperWorld.h" 34 #include "bindings/v8/DOMWrapperWorld.h"
35 #include "bindings/v8/PageScriptDebugServer.h" 35 #include "bindings/v8/PageScriptDebugServer.h"
36 #include "core/inspector/InspectorOverlay.h" 36 #include "core/inspector/InspectorOverlay.h"
37 #include "core/inspector/InspectorPageAgent.h" 37 #include "core/inspector/InspectorPageAgent.h"
38 #include "core/inspector/InstrumentingAgents.h" 38 #include "core/inspector/InstrumentingAgents.h"
39 #include "core/page/Page.h" 39 #include "core/page/Page.h"
40 #include "core/page/PageConsole.h" 40 #include "core/page/PageConsole.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 PassOwnPtr<PageDebuggerAgent> PageDebuggerAgent::create(InstrumentingAgents* ins trumentingAgents, InspectorCompositeState* inspectorState, PageScriptDebugServer * pageScriptDebugServer, InspectorPageAgent* pageAgent, InjectedScriptManager* i njectedScriptManager, InspectorOverlay* overlay) 44 PassRefPtr<PageDebuggerAgent> PageDebuggerAgent::create(InstrumentingAgents* ins trumentingAgents, InspectorState* inspectorState, PageScriptDebugServer* pageScr iptDebugServer, PassRefPtr<InspectorPageAgent> pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
45 { 45 {
46 return adoptPtr(new PageDebuggerAgent(instrumentingAgents, inspectorState, p ageScriptDebugServer, pageAgent, injectedScriptManager, overlay)); 46 return adoptRef(new PageDebuggerAgent(instrumentingAgents, inspectorState, p ageScriptDebugServer, pageAgent, injectedScriptManager, overlay));
47 } 47 }
48 48
49 PageDebuggerAgent::PageDebuggerAgent(InstrumentingAgents* instrumentingAgents, I nspectorCompositeState* inspectorState, PageScriptDebugServer* pageScriptDebugSe rver, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManage r, InspectorOverlay* overlay) 49 PageDebuggerAgent::PageDebuggerAgent(InstrumentingAgents* instrumentingAgents, I nspectorState* inspectorState, PageScriptDebugServer* pageScriptDebugServer, Pas sRefPtr<InspectorPageAgent> pageAgent, InjectedScriptManager* injectedScriptMana ger, InspectorOverlay* overlay)
50 : InspectorDebuggerAgent(instrumentingAgents, inspectorState, injectedScript Manager) 50 : InspectorDebuggerAgent(instrumentingAgents, inspectorState, injectedScript Manager)
51 , m_pageScriptDebugServer(pageScriptDebugServer) 51 , m_pageScriptDebugServer(pageScriptDebugServer)
52 , m_pageAgent(pageAgent) 52 , m_pageAgent(pageAgent)
53 , m_overlay(overlay) 53 , m_overlay(overlay)
54 { 54 {
55 m_overlay->overlayHost()->setListener(this); 55 m_overlay->overlayHost()->setListener(this);
56 } 56 }
57 57
58 PageDebuggerAgent::~PageDebuggerAgent() 58 PageDebuggerAgent::~PageDebuggerAgent()
59 { 59 {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 void PageDebuggerAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorl d* world) 133 void PageDebuggerAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorl d* world)
134 { 134 {
135 if (world != mainThreadNormalWorld() || frame != m_pageAgent->mainFrame()) 135 if (world != mainThreadNormalWorld() || frame != m_pageAgent->mainFrame())
136 return; 136 return;
137 137
138 reset(); 138 reset();
139 scriptDebugServer().setScriptPreprocessor(m_pageAgent->scriptPreprocessor()) ; 139 scriptDebugServer().setScriptPreprocessor(m_pageAgent->scriptPreprocessor()) ;
140 } 140 }
141 141
142 PageDebuggerController::PageDebuggerController(InstrumentingAgents* instrumentin gAgents, InspectorCompositeState* compositeState, PageScriptDebugServer* pageScr iptDebugServer, InspectorPageController* pageController, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
143 : InspectorDebuggerController(instrumentingAgents, compositeState)
144 {
145 setAgent(PageDebuggerAgent::create(m_instrumentingAgents, m_state, pageScrip tDebugServer, pageController->getAgent(), injectedScriptManager, overlay));
146 }
147
142 } // namespace WebCore 148 } // namespace WebCore
143 149
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698