summaryrefslogtreecommitdiff
path: root/Source/WebCore/inspector/InspectorWebAgentBase.h
diff options
context:
space:
mode:
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)