summaryrefslogtreecommitdiff
path: root/Source/WebCore/inspector/CommandLineAPIHost.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/inspector/CommandLineAPIHost.h')
-rw-r--r--Source/WebCore/inspector/CommandLineAPIHost.h61
1 files changed, 26 insertions, 35 deletions
diff --git a/Source/WebCore/inspector/CommandLineAPIHost.h b/Source/WebCore/inspector/CommandLineAPIHost.h
index 6f9025f08..3bcc07e9a 100644
--- a/Source/WebCore/inspector/CommandLineAPIHost.h
+++ b/Source/WebCore/inspector/CommandLineAPIHost.h
@@ -11,7 +11,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -27,21 +27,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CommandLineAPIHost_h
-#define CommandLineAPIHost_h
+#pragma once
-#include "ConsoleTypes.h"
-#include "ScriptState.h"
+#include <inspector/PerGlobalObjectWrapperWorld.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
-namespace Deprecated {
-class ScriptValue;
+namespace JSC {
+class JSValue;
}
namespace Inspector {
class InspectorAgent;
+class InspectorConsoleAgent;
class InspectorObject;
class InspectorValue;
}
@@ -49,10 +48,10 @@ class InspectorValue;
namespace WebCore {
class Database;
-class InspectorConsoleAgent;
class InspectorDOMAgent;
class InspectorDOMStorageAgent;
class InspectorDatabaseAgent;
+class JSDOMGlobalObject;
class Node;
class Storage;
@@ -60,25 +59,21 @@ struct EventListenerInfo;
class CommandLineAPIHost : public RefCounted<CommandLineAPIHost> {
public:
- static PassRefPtr<CommandLineAPIHost> create();
+ static Ref<CommandLineAPIHost> create();
~CommandLineAPIHost();
void init(Inspector::InspectorAgent* inspectorAgent
- , InspectorConsoleAgent* consoleAgent
- , InspectorDOMAgent* domAgent
- , InspectorDOMStorageAgent* domStorageAgent
-#if ENABLE(SQL_DATABASE)
- , InspectorDatabaseAgent* databaseAgent
-#endif
+ , Inspector::InspectorConsoleAgent* consoleAgent
+ , InspectorDOMAgent* domAgent
+ , InspectorDOMStorageAgent* domStorageAgent
+ , InspectorDatabaseAgent* databaseAgent
)
{
m_inspectorAgent = inspectorAgent;
m_consoleAgent = consoleAgent;
m_domAgent = domAgent;
m_domStorageAgent = domStorageAgent;
-#if ENABLE(SQL_DATABASE)
m_databaseAgent = databaseAgent;
-#endif
}
void disconnect();
@@ -89,36 +84,32 @@ public:
class InspectableObject {
WTF_MAKE_FAST_ALLOCATED;
public:
- virtual Deprecated::ScriptValue get(JSC::ExecState*);
+ virtual JSC::JSValue get(JSC::ExecState&);
virtual ~InspectableObject() { }
};
- void addInspectedObject(PassOwnPtr<InspectableObject>);
- void clearInspectedObjects();
- InspectableObject* inspectedObject(unsigned index);
- void inspectImpl(PassRefPtr<Inspector::InspectorValue> objectToInspect, PassRefPtr<Inspector::InspectorValue> hints);
+ void addInspectedObject(std::unique_ptr<InspectableObject>);
+ InspectableObject* inspectedObject();
+ void inspectImpl(RefPtr<Inspector::InspectorValue>&& objectToInspect, RefPtr<Inspector::InspectorValue>&& hints);
void getEventListenersImpl(Node*, Vector<EventListenerInfo>& listenersArray);
-#if ENABLE(SQL_DATABASE)
String databaseIdImpl(Database*);
-#endif
String storageIdImpl(Storage*);
+ JSC::JSValue wrapper(JSC::ExecState*, JSDOMGlobalObject*);
+ void clearAllWrappers();
+
private:
CommandLineAPIHost();
- Inspector::InspectorAgent* m_inspectorAgent;
- InspectorConsoleAgent* m_consoleAgent;
- InspectorDOMAgent* m_domAgent;
- InspectorDOMStorageAgent* m_domStorageAgent;
-#if ENABLE(SQL_DATABASE)
- InspectorDatabaseAgent* m_databaseAgent;
-#endif
+ Inspector::InspectorAgent* m_inspectorAgent {nullptr};
+ Inspector::InspectorConsoleAgent* m_consoleAgent {nullptr};
+ InspectorDOMAgent* m_domAgent {nullptr};
+ InspectorDOMStorageAgent* m_domStorageAgent {nullptr};
+ InspectorDatabaseAgent* m_databaseAgent {nullptr};
- Vector<OwnPtr<InspectableObject>> m_inspectedObjects;
- OwnPtr<InspectableObject> m_defaultInspectableObject;
+ std::unique_ptr<InspectableObject> m_inspectedObject; // $0
+ Inspector::PerGlobalObjectWrapperWorld m_wrappers;
};
} // namespace WebCore
-
-#endif // !defined(CommandLineAPIHost_h)