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

Unified Diff: sky/engine/core/inspector/InspectorBaseAgent.h

Issue 727593004: Wire up the Inspector V8 Debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Actually works Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/inspector/InspectorBaseAgent.h
diff --git a/sky/engine/bindings/core/v8/ScriptFunctionCall.h b/sky/engine/core/inspector/InspectorBaseAgent.h
similarity index 57%
copy from sky/engine/bindings/core/v8/ScriptFunctionCall.h
copy to sky/engine/core/inspector/InspectorBaseAgent.h
index eeb9b8a2099b1f40347f3dc940a55caf8879c01e..208c10508d69f389dbbfc92583b14365070e29ae 100644
--- a/sky/engine/bindings/core/v8/ScriptFunctionCall.h
+++ b/sky/engine/core/inspector/InspectorBaseAgent.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,50 +28,65 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptFunctionCall_h
-#define ScriptFunctionCall_h
-
-#include "bindings/core/v8/ScriptValue.h"
+#ifndef InspectorBaseAgent_h
+#define InspectorBaseAgent_h
+#include "core/InspectorBackendDispatcher.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Forward.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
namespace blink {
-class ScriptValue;
-class ScriptCallArgumentHandler {
+class InspectorFrontend;
+class InspectorCompositeState;
+class InspectorState;
+class InstrumentingAgents;
+
+class InspectorAgent {
public:
- ScriptCallArgumentHandler(ScriptState* scriptState) : m_scriptState(scriptState) { }
-
- void appendArgument(const ScriptValue&);
- void appendArgument(const String&);
- void appendArgument(const char*);
- void appendArgument(long);
- void appendArgument(long long);
- void appendArgument(unsigned);
- void appendArgument(unsigned long);
- void appendArgument(int);
- void appendArgument(bool);
- void appendArgument(const Vector<ScriptValue>&);
- void appendUndefinedArgument();
+ explicit InspectorAgent(const String&);
+ virtual ~InspectorAgent();
+
+ void init(InstrumentingAgents* agents, InspectorState* inspectorState);
+
+ virtual void setFrontend(InspectorFrontend*) { }
+ virtual void clearFrontend() { }
+ virtual void restore() { }
+ virtual void discardAgent() { }
+ virtual void didCommitLoadForMainFrame() { }
+ virtual void flushPendingFrontendMessages() { }
+
+private:
+ virtual void virtualInit() { }
+
+ String name() { return m_name; }
protected:
- RefPtr<ScriptState> m_scriptState;
- Vector<ScriptValue> m_arguments;
+ RawPtr<InstrumentingAgents> m_instrumentingAgents;
+ RawPtr<InspectorState> m_state;
+
+private:
+ String m_name;
};
-class ScriptFunctionCall : public ScriptCallArgumentHandler {
+template<typename T>
+class InspectorBaseAgent : public InspectorAgent {
public:
- ScriptFunctionCall(const ScriptValue& thisObject, const String& name);
- ScriptValue call(bool& hadException, bool reportExceptions = true);
- ScriptValue call();
- ScriptValue construct(bool& hadException, bool reportExceptions = true);
+ virtual ~InspectorBaseAgent() { }
protected:
- ScriptValue m_thisObject;
- String m_name;
+ explicit InspectorBaseAgent(const String& name) : InspectorAgent(name)
+ {
+ }
};
+inline bool asBool(const bool* const b)
+{
+ return b ? *b : false;
+}
+
} // namespace blink
-#endif // ScriptFunctionCall
+#endif // !defined(InspectorBaseAgent_h)

Powered by Google App Engine
This is Rietveld 408576698