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

Side by Side Diff: Source/core/inspector/InspectorRuntimeAgent.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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class InspectorArray; 44 class InspectorArray;
45 class InspectorFrontend; 45 class InspectorFrontend;
46 class InspectorObject; 46 class InspectorObject;
47 class InspectorValue; 47 class InspectorValue;
48 class InstrumentingAgents; 48 class InstrumentingAgents;
49 class ScriptDebugServer; 49 class ScriptDebugServer;
50 class WorkerContext; 50 class WorkerContext;
51 51
52 typedef String ErrorString; 52 typedef String ErrorString;
53 53
54 class InspectorRuntimeAgent : public InspectorBaseAgent<InspectorRuntimeAgent>, public InspectorBackendDispatcher::RuntimeCommandHandler { 54 class InspectorRuntimeAgent : public InspectorBaseAgent, public InspectorBackend Dispatcher::RuntimeCommandHandler {
55 WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent); 55 WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent);
56 public: 56 public:
57 virtual ~InspectorRuntimeAgent(); 57 virtual ~InspectorRuntimeAgent();
58 58
59 bool enabled() { return m_enabled; } 59 bool enabled() { return m_enabled; }
60 // Part of the protocol. 60 // Part of the protocol.
61 virtual void enable(ErrorString*) { m_enabled = true; } 61 virtual void enable(ErrorString*) { m_enabled = true; }
62 virtual void disable(ErrorString*) { m_enabled = false; } 62 virtual void disable(ErrorString*) { m_enabled = false; }
63 virtual void evaluate(ErrorString*, 63 virtual void evaluate(ErrorString*,
64 const String& expression, 64 const String& expression,
(...skipping 13 matching lines...) Expand all
78 const bool* returnByValue, 78 const bool* returnByValue,
79 const bool* generatePreview, 79 const bool* generatePreview,
80 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, 80 RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
81 TypeBuilder::OptOutput<bool>* wasThrown); 81 TypeBuilder::OptOutput<bool>* wasThrown);
82 virtual void releaseObject(ErrorString*, const String& objectId); 82 virtual void releaseObject(ErrorString*, const String& objectId);
83 virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, const bool* accessorPropertiesOnly, RefPtr<TypeBuilder::Array<Ty peBuilder::Runtime::PropertyDescriptor> >& result, RefPtr<TypeBuilder::Array<Typ eBuilder::Runtime::InternalPropertyDescriptor> >& internalProperties); 83 virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, const bool* accessorPropertiesOnly, RefPtr<TypeBuilder::Array<Ty peBuilder::Runtime::PropertyDescriptor> >& result, RefPtr<TypeBuilder::Array<Typ eBuilder::Runtime::InternalPropertyDescriptor> >& internalProperties);
84 virtual void releaseObjectGroup(ErrorString*, const String& objectGroup); 84 virtual void releaseObjectGroup(ErrorString*, const String& objectGroup);
85 virtual void run(ErrorString*); 85 virtual void run(ErrorString*);
86 86
87 protected: 87 protected:
88 InspectorRuntimeAgent(InstrumentingAgents*, InspectorCompositeState*, Inject edScriptManager*, ScriptDebugServer*); 88 InspectorRuntimeAgent(InstrumentingAgents*, InspectorState*, InjectedScriptM anager*, ScriptDebugServer*);
89 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut ionContextId) = 0; 89 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut ionContextId) = 0;
90 90
91 virtual void muteConsole() = 0; 91 virtual void muteConsole() = 0;
92 virtual void unmuteConsole() = 0; 92 virtual void unmuteConsole() = 0;
93 93
94 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana ger; } 94 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana ger; }
95 bool m_enabled; 95 bool m_enabled;
96 96
97 private: 97 private:
98 InjectedScriptManager* m_injectedScriptManager; 98 InjectedScriptManager* m_injectedScriptManager;
99 ScriptDebugServer* m_scriptDebugServer; 99 ScriptDebugServer* m_scriptDebugServer;
100 }; 100 };
101 101
102 class InspectorRuntimeFactory : public InspectorBaseFactory<InspectorRuntimeFact ory, InspectorRuntimeAgent> {
103 protected:
104 InspectorRuntimeFactory(InstrumentingAgents* instrumentingAgents, InspectorC ompositeState* compositeState)
105 : InspectorBaseFactory<InspectorRuntimeFactory, InspectorRuntimeAgent>(" Runtime", instrumentingAgents, compositeState) { }
106 };
107
102 } // namespace WebCore 108 } // namespace WebCore
103 109
104 #endif // InspectorRuntimeAgent_h 110 #endif // InspectorRuntimeAgent_h
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.cpp ('k') | Source/core/inspector/InspectorRuntimeAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698