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

Side by Side Diff: Source/core/inspector/PageDebuggerAgent.h

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 21 matching lines...) Expand all
32 #define PageDebuggerAgent_h 32 #define PageDebuggerAgent_h
33 33
34 #include "bindings/v8/PageScriptDebugServer.h" 34 #include "bindings/v8/PageScriptDebugServer.h"
35 #include "core/inspector/InspectorDebuggerAgent.h" 35 #include "core/inspector/InspectorDebuggerAgent.h"
36 #include "core/inspector/InspectorOverlayHost.h" 36 #include "core/inspector/InspectorOverlayHost.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class InspectorOverlay; 40 class InspectorOverlay;
41 class InspectorPageAgent; 41 class InspectorPageAgent;
42 class InspectorPageController;
42 class Page; 43 class Page;
43 class PageScriptDebugServer; 44 class PageScriptDebugServer;
44 45
45 class PageDebuggerAgent : 46 class PageDebuggerAgent :
46 public InspectorDebuggerAgent, 47 public InspectorDebuggerAgent,
47 public InspectorOverlayHost::Listener { 48 public InspectorOverlayHost::Listener {
48 WTF_MAKE_NONCOPYABLE(PageDebuggerAgent); 49 WTF_MAKE_NONCOPYABLE(PageDebuggerAgent);
49 WTF_MAKE_FAST_ALLOCATED; 50 WTF_MAKE_FAST_ALLOCATED;
50 public: 51 public:
51 static PassOwnPtr<PageDebuggerAgent> create(InstrumentingAgents*, InspectorC ompositeState*, PageScriptDebugServer*, InspectorPageAgent*, InjectedScriptManag er*, InspectorOverlay*); 52 static PassRefPtr<PageDebuggerAgent> create(InstrumentingAgents*, InspectorS tate*, PageScriptDebugServer*, PassRefPtr<InspectorPageAgent>, InjectedScriptMan ager*, InspectorOverlay*);
52 virtual ~PageDebuggerAgent(); 53 virtual ~PageDebuggerAgent();
53 54
54 void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*); 55 void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
55 56
56 protected: 57 protected:
57 virtual void enable(); 58 virtual void enable();
58 virtual void disable(); 59 virtual void disable();
59 60
60 private: 61 private:
61 virtual void startListeningScriptDebugServer(); 62 virtual void startListeningScriptDebugServer();
62 virtual void stopListeningScriptDebugServer(); 63 virtual void stopListeningScriptDebugServer();
63 virtual PageScriptDebugServer& scriptDebugServer(); 64 virtual PageScriptDebugServer& scriptDebugServer();
64 virtual void muteConsole(); 65 virtual void muteConsole();
65 virtual void unmuteConsole(); 66 virtual void unmuteConsole();
66 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& me ssage, const String& sourceURL); 67 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& me ssage, const String& sourceURL);
67 68
68 // InspectorOverlayHost::Listener implementation. 69 // InspectorOverlayHost::Listener implementation.
69 virtual void overlayResumed(); 70 virtual void overlayResumed();
70 virtual void overlaySteppedOver(); 71 virtual void overlaySteppedOver();
71 72
72 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut ionContextId); 73 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut ionContextId);
73 virtual void setOverlayMessage(ErrorString*, const String*); 74 virtual void setOverlayMessage(ErrorString*, const String*);
74 75
75 PageDebuggerAgent(InstrumentingAgents*, InspectorCompositeState*, PageScript DebugServer*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*); 76 PageDebuggerAgent(InstrumentingAgents*, InspectorState*, PageScriptDebugServ er*, PassRefPtr<InspectorPageAgent>, InjectedScriptManager*, InspectorOverlay*);
76 PageScriptDebugServer* m_pageScriptDebugServer; 77 PageScriptDebugServer* m_pageScriptDebugServer;
77 InspectorPageAgent* m_pageAgent; 78 RefPtr<InspectorPageAgent> m_pageAgent;
78 InspectorOverlay* m_overlay; 79 InspectorOverlay* m_overlay;
79 }; 80 };
80 81
82 class PageDebuggerController: public InspectorDebuggerController {
83 public:
84
85 static PassOwnPtr<PageDebuggerController> create(InstrumentingAgents* instru mentingAgents, InspectorCompositeState* compositeState, PageScriptDebugServer* p ageScriptDebugServer, InspectorPageController* pageController, InjectedScriptMan ager* injectedScriptManager, InspectorOverlay* overlay)
86 {
87 return adoptPtr(new PageDebuggerController(instrumentingAgents, composit eState, pageScriptDebugServer, pageController, injectedScriptManager, overlay));
88 }
89
90 protected:
91 PageDebuggerController(InstrumentingAgents*, InspectorCompositeState*, PageS criptDebugServer*, InspectorPageController*, InjectedScriptManager*, InspectorOv erlay*);
92 };
93
81 } // namespace WebCore 94 } // namespace WebCore
82 95
83 96
84 #endif // !defined(PageDebuggerAgent_h) 97 #endif // !defined(PageDebuggerAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698