summaryrefslogtreecommitdiff
path: root/Source/WebCore/inspector/InspectorWebAgentBase.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/inspector/InspectorWebAgentBase.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/inspector/InspectorWebAgentBase.h')
-rw-r--r--Source/WebCore/inspector/InspectorWebAgentBase.h49
1 files changed, 40 insertions, 9 deletions
diff --git a/Source/WebCore/inspector/InspectorWebAgentBase.h b/Source/WebCore/inspector/InspectorWebAgentBase.h
index dfcc4a845..b8d1d38d6 100644
--- a/Source/WebCore/inspector/InspectorWebAgentBase.h
+++ b/Source/WebCore/inspector/InspectorWebAgentBase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2013, 2015 Apple Inc. All Rights Reserved.
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,28 +24,59 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef InspectorWebAgentBase_h
-#define InspectorWebAgentBase_h
+#pragma once
-#include "InspectorForwarding.h"
#include <inspector/InspectorAgentBase.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class InstrumentingAgents;
+class Page;
+class WorkerGlobalScope;
+
+// FIXME: move this to Inspector namespace when remaining agents move.
+struct WebAgentContext : public Inspector::AgentContext {
+ WebAgentContext(AgentContext& context, InstrumentingAgents& instrumentingAgents)
+ : AgentContext(context)
+ , instrumentingAgents(instrumentingAgents)
+ {
+ }
+
+ InstrumentingAgents& instrumentingAgents;
+};
+
+struct PageAgentContext : public WebAgentContext {
+ PageAgentContext(WebAgentContext& context, Page& inspectedPage)
+ : WebAgentContext(context)
+ , inspectedPage(inspectedPage)
+ {
+ }
+
+ Page& inspectedPage;
+};
+
+struct WorkerAgentContext : public WebAgentContext {
+ WorkerAgentContext(WebAgentContext& context, WorkerGlobalScope& workerGlobalScope)
+ : WebAgentContext(context)
+ , workerGlobalScope(workerGlobalScope)
+ {
+ }
+
+ WorkerGlobalScope& workerGlobalScope;
+};
class InspectorAgentBase : public Inspector::InspectorAgentBase {
protected:
- InspectorAgentBase(const String& name, InstrumentingAgents* instrumentingAgents)
+ InspectorAgentBase(const String& name, WebAgentContext& context)
: Inspector::InspectorAgentBase(name)
- , m_instrumentingAgents(instrumentingAgents)
+ , m_instrumentingAgents(context.instrumentingAgents)
+ , m_environment(context.environment)
{
}
- InstrumentingAgents* m_instrumentingAgents;
+ InstrumentingAgents& m_instrumentingAgents;
+ Inspector::InspectorEnvironment& m_environment;
};
} // namespace WebCore
-
-#endif // !defined(InspectorWebAgentBase_h)