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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments 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
« no previous file with comments | « Source/core/inspector/PageDebuggerAgent.cpp ('k') | Source/core/inspector/PageRuntimeAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 22 matching lines...) Expand all
33 33
34 34
35 #include "InspectorFrontend.h" 35 #include "InspectorFrontend.h"
36 #include "bindings/v8/ScriptState.h" 36 #include "bindings/v8/ScriptState.h"
37 #include "core/inspector/InspectorRuntimeAgent.h" 37 #include "core/inspector/InspectorRuntimeAgent.h"
38 #include <wtf/PassOwnPtr.h> 38 #include <wtf/PassOwnPtr.h>
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 class InspectorPageAgent; 42 class InspectorPageAgent;
43 class InspectorPageFactory;
43 class Page; 44 class Page;
44 class SecurityOrigin; 45 class SecurityOrigin;
45 46
46 class PageRuntimeAgent : public InspectorRuntimeAgent { 47 class PageRuntimeAgent : public InspectorRuntimeAgent {
47 public: 48 public:
48 static PassOwnPtr<PageRuntimeAgent> create(InstrumentingAgents* instrumentin gAgents, InspectorCompositeState* state, InjectedScriptManager* injectedScriptMa nager, ScriptDebugServer* scriptDebugServer, Page* page, InspectorPageAgent* pag eAgent) 49 static PassRefPtr<PageRuntimeAgent> create(InstrumentingAgents*, InspectorSt ate*, Page*, PassRefPtr<InspectorPageAgent>, InjectedScriptManager*, ScriptDebug Server*);
49 {
50 return adoptPtr(new PageRuntimeAgent(instrumentingAgents, state, injecte dScriptManager, scriptDebugServer, page, pageAgent));
51 }
52 virtual ~PageRuntimeAgent(); 50 virtual ~PageRuntimeAgent();
53 virtual void setFrontend(InspectorFrontend*); 51 virtual void setFrontend(InspectorFrontend*);
54 virtual void clearFrontend(); 52 virtual void clearFrontend();
55 virtual void restore(); 53 virtual void restore();
56 virtual void enable(ErrorString*); 54 virtual void enable(ErrorString*);
57 virtual void disable(ErrorString*); 55 virtual void disable(ErrorString*);
58 56
59 void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*); 57 void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
60 void didCreateIsolatedContext(Frame*, ScriptState*, SecurityOrigin*); 58 void didCreateIsolatedContext(Frame*, ScriptState*, SecurityOrigin*);
61 59
62 private: 60 private:
63 PageRuntimeAgent(InstrumentingAgents*, InspectorCompositeState*, InjectedScr iptManager*, ScriptDebugServer*, Page*, InspectorPageAgent*); 61 PageRuntimeAgent(InstrumentingAgents*, InspectorState*, Page*, PassRefPtr<In spectorPageAgent>, InjectedScriptManager*, ScriptDebugServer*);
64 62
65 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut ionContextId); 63 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut ionContextId);
66 virtual void muteConsole(); 64 virtual void muteConsole();
67 virtual void unmuteConsole(); 65 virtual void unmuteConsole();
68 void reportExecutionContextCreation(); 66 void reportExecutionContextCreation();
69 void notifyContextCreated(const String& frameId, ScriptState*, SecurityOrigi n*, bool isPageContext); 67 void notifyContextCreated(const String& frameId, ScriptState*, SecurityOrigi n*, bool isPageContext);
70 68
71 Page* m_inspectedPage; 69 Page* m_inspectedPage;
72 InspectorPageAgent* m_pageAgent; 70 RefPtr<InspectorPageAgent> m_pageAgent;
73 InspectorFrontend::Runtime* m_frontend; 71 InspectorFrontend::Runtime* m_frontend;
74 bool m_mainWorldContextCreated; 72 bool m_mainWorldContextCreated;
75 }; 73 };
76 74
75 class PageRuntimeFactory : public InspectorRuntimeFactory {
76 public:
77
78 static PassOwnPtr<PageRuntimeFactory> create(InstrumentingAgents* instrument ingAgents, InspectorCompositeState* compositeState, Page* page, InspectorPageFac tory* pageFactory, InjectedScriptManager* injectedScriptManager, ScriptDebugServ er* scriptDebugServer)
79 {
80 return adoptPtr(new PageRuntimeFactory(instrumentingAgents, compositeSta te, page, pageFactory, injectedScriptManager, scriptDebugServer));
81 }
82
83 protected:
84 PageRuntimeFactory(InstrumentingAgents*, InspectorCompositeState*, Page*, In spectorPageFactory*, InjectedScriptManager*, ScriptDebugServer*);
85 };
86
77 } // namespace WebCore 87 } // namespace WebCore
78 88
79 89
80 #endif // !defined(InspectorPagerAgent_h) 90 #endif // !defined(InspectorPagerAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/PageDebuggerAgent.cpp ('k') | Source/core/inspector/PageRuntimeAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698