| 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 22 matching lines...) Expand all Loading... |
| 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 InspectorPageController; |
| 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 PageRuntimeController: public InspectorRuntimeController { |
| 76 public: |
| 77 |
| 78 static PassOwnPtr<PageRuntimeController> create(InstrumentingAgents* instrum
entingAgents, InspectorCompositeState* compositeState, Page* page, InspectorPage
Controller* pageController, InjectedScriptManager* injectedScriptManager, Script
DebugServer* scriptDebugServer) |
| 79 { |
| 80 return adoptPtr(new PageRuntimeController(instrumentingAgents, composite
State, page, pageController, injectedScriptManager, scriptDebugServer)); |
| 81 } |
| 82 |
| 83 protected: |
| 84 PageRuntimeController(InstrumentingAgents*, InspectorCompositeState*, Page*,
InspectorPageController*, InjectedScriptManager*, ScriptDebugServer*); |
| 85 }; |
| 86 |
| 77 } // namespace WebCore | 87 } // namespace WebCore |
| 78 | 88 |
| 79 | 89 |
| 80 #endif // !defined(InspectorPagerAgent_h) | 90 #endif // !defined(InspectorPagerAgent_h) |
| OLD | NEW |