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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.h

Issue 1702673002: DevTools: migrate remote debugging protocol generators to jinja2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 26 matching lines...) Expand all
37 #include "wtf/Noncopyable.h" 37 #include "wtf/Noncopyable.h"
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class InjectedScriptManager; 41 class InjectedScriptManager;
42 class JSONArray; 42 class JSONArray;
43 class V8DebuggerImpl; 43 class V8DebuggerImpl;
44 44
45 typedef String ErrorString; 45 typedef String ErrorString;
46 46
47 using protocol::OptionalValue;
48
47 class V8RuntimeAgentImpl : public V8RuntimeAgent { 49 class V8RuntimeAgentImpl : public V8RuntimeAgent {
48 WTF_MAKE_NONCOPYABLE(V8RuntimeAgentImpl); 50 WTF_MAKE_NONCOPYABLE(V8RuntimeAgentImpl);
49 public: 51 public:
50 V8RuntimeAgentImpl(V8DebuggerImpl*); 52 V8RuntimeAgentImpl(V8DebuggerImpl*);
51 ~V8RuntimeAgentImpl() override; 53 ~V8RuntimeAgentImpl() override;
52 54
53 // State management methods. 55 // State management methods.
54 void setInspectorState(PassRefPtr<JSONObject>) override; 56 void setInspectorState(PassRefPtr<JSONObject>) override;
55 void setFrontend(protocol::Frontend::Runtime*) override; 57 void setFrontend(protocol::Frontend::Runtime*) override;
56 void clearFrontend() override; 58 void clearFrontend() override;
57 void restore() override; 59 void restore() override;
58 60
59 // Part of the protocol. 61 // Part of the protocol.
60 void enable(ErrorString*) override; 62 void enable(ErrorString*) override;
61 void disable(ErrorString*) override; 63 void disable(ErrorString*) override;
62 void evaluate(ErrorString*, 64 void evaluate(ErrorString*,
63 const String& expression, 65 const String& expression,
64 const String* objectGroup, 66 const OptionalValue<String>& objectGroup,
65 const bool* includeCommandLineAPI, 67 const OptionalValue<bool>& includeCommandLineAPI,
66 const bool* doNotPauseOnExceptionsAndMuteConsole, 68 const OptionalValue<bool>& doNotPauseOnExceptionsAndMuteConsole,
67 const int* executionContextId, 69 const OptionalValue<int>& executionContextId,
68 const bool* returnByValue, 70 const OptionalValue<bool>& returnByValue,
69 const bool* generatePreview, 71 const OptionalValue<bool>& generatePreview,
70 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>& result, 72 OwnPtr<protocol::Runtime::RemoteObject>* result,
71 protocol::TypeBuilder::OptOutput<bool>* wasThrown, 73 OptionalValue<bool>* wasThrown,
72 RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>&) override; 74 OwnPtr<protocol::Runtime::ExceptionDetails>*) override;
73 void callFunctionOn(ErrorString*, 75 void callFunctionOn(ErrorString*,
74 const String& objectId, 76 const String& objectId,
75 const String& expression, 77 const String& expression,
76 const RefPtr<JSONArray>* optionalArguments, 78 PassOwnPtr<protocol::Array<protocol::Runtime::CallArgument>> optionalArg uments,
77 const bool* doNotPauseOnExceptionsAndMuteConsole, 79 const OptionalValue<bool>& doNotPauseOnExceptionsAndMuteConsole,
78 const bool* returnByValue, 80 const OptionalValue<bool>& returnByValue,
79 const bool* generatePreview, 81 const OptionalValue<bool>& generatePreview,
80 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>& result, 82 OwnPtr<protocol::Runtime::RemoteObject>* result,
81 protocol::TypeBuilder::OptOutput<bool>* wasThrown) override; 83 OptionalValue<bool>* wasThrown) override;
82 void releaseObject(ErrorString*, const String& objectId) override; 84 void releaseObject(ErrorString*, const String& objectId) override;
83 void getProperties(ErrorString*, const String& objectId, const bool* ownProp erties, const bool* accessorPropertiesOnly, const bool* generatePreview, RefPtr< protocol::TypeBuilder::Array<protocol::TypeBuilder::Runtime::PropertyDescriptor> >& result, RefPtr<protocol::TypeBuilder::Array<protocol::TypeBuilder::Runtime::I nternalPropertyDescriptor>>& internalProperties, RefPtr<protocol::TypeBuilder::R untime::ExceptionDetails>&) override; 85 void getProperties(ErrorString*,
86 const String& objectId,
87 const OptionalValue<bool>& ownProperties,
88 const OptionalValue<bool>& accessorPropertiesOnly,
89 const OptionalValue<bool>& generatePreview,
90 OwnPtr<protocol::Array<protocol::Runtime::PropertyDescriptor>>* result,
91 OwnPtr<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* internalProperties,
92 OwnPtr<protocol::Runtime::ExceptionDetails>*) override;
84 void releaseObjectGroup(ErrorString*, const String& objectGroup) override; 93 void releaseObjectGroup(ErrorString*, const String& objectGroup) override;
85 void run(ErrorString*) override; 94 void run(ErrorString*) override;
86 void isRunRequired(ErrorString*, bool* out_result) override; 95 void isRunRequired(ErrorString*, bool* result) override;
87 void setCustomObjectFormatterEnabled(ErrorString*, bool) override; 96 void setCustomObjectFormatterEnabled(ErrorString*, bool) override;
88 void compileScript(ErrorString*, const String& expression, const String& sou rceURL, bool persistScript, int executionContextId, protocol::TypeBuilder::OptOu tput<protocol::TypeBuilder::Runtime::ScriptId>*, RefPtr<protocol::TypeBuilder::R untime::ExceptionDetails>&) override; 97 void compileScript(ErrorString*,
89 void runScript(ErrorString*, const protocol::TypeBuilder::Runtime::ScriptId& , int executionContextId, const String* objectGroup, const bool* doNotPauseOnExc eptionsAndMuteConsole, const bool* includeCommandLineAPI, RefPtr<protocol::TypeB uilder::Runtime::RemoteObject>& result, RefPtr<protocol::TypeBuilder::Runtime::E xceptionDetails>&) override; 98 const String& expression,
99 const String& sourceURL,
100 bool persistScript,
101 int executionContextId,
102 OptionalValue<protocol::Runtime::ScriptId>*,
103 OwnPtr<protocol::Runtime::ExceptionDetails>*) override;
104 void runScript(ErrorString*,
105 const protocol::Runtime::ScriptId&,
106 int executionContextId,
107 const OptionalValue<String>& objectGroup,
108 const OptionalValue<bool>& doNotPauseOnExceptionsAndMuteConsole,
109 const OptionalValue<bool>& includeCommandLineAPI,
110 OwnPtr<protocol::Runtime::RemoteObject>* result,
111 OwnPtr<protocol::Runtime::ExceptionDetails>*) override;
90 112
91 V8DebuggerImpl* debugger() { return m_debugger; } 113 V8DebuggerImpl* debugger() { return m_debugger; }
92 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana ger.get(); } 114 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana ger.get(); }
93 115
94 private: 116 private:
95 void setClearConsoleCallback(PassOwnPtr<ClearConsoleCallback>) override; 117 void setClearConsoleCallback(PassOwnPtr<ClearConsoleCallback>) override;
96 void setInspectObjectCallback(PassOwnPtr<InspectCallback>) override; 118 void setInspectObjectCallback(PassOwnPtr<InspectCallback>) override;
97 int ensureDefaultContextAvailable(v8::Local<v8::Context>) override; 119 int ensureDefaultContextAvailable(v8::Local<v8::Context>) override;
98 PassRefPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapObject(v8::Loca l<v8::Context>, v8::Local<v8::Value>, const String& groupName, bool generatePrev iew = false) override; 120 PassOwnPtr<protocol::Runtime::RemoteObject> wrapObject(v8::Local<v8::Context >, v8::Local<v8::Value>, const String& groupName, bool generatePreview = false) override;
99 PassRefPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapTable(v8::Local <v8::Context>, v8::Local<v8::Value> table, v8::Local<v8::Value> columns) overrid e; 121 PassOwnPtr<protocol::Runtime::RemoteObject> wrapTable(v8::Local<v8::Context> , v8::Local<v8::Value> table, v8::Local<v8::Value> columns) override;
100 void disposeObjectGroup(const String&) override; 122 void disposeObjectGroup(const String&) override;
101 v8::Local<v8::Value> findObject(const String& objectId, v8::Local<v8::Contex t>* = nullptr, String* groupName = nullptr) override; 123 v8::Local<v8::Value> findObject(const String& objectId, v8::Local<v8::Contex t>* = nullptr, String* groupName = nullptr) override;
102 void addInspectedObject(PassOwnPtr<Inspectable>) override; 124 void addInspectedObject(PassOwnPtr<Inspectable>) override;
103 void clearInspectedObjects() override; 125 void clearInspectedObjects() override;
104 126
105 void reportExecutionContextCreated(v8::Local<v8::Context>, const String& typ e, const String& origin, const String& humanReadableName, const String& frameId) override; 127 void reportExecutionContextCreated(v8::Local<v8::Context>, const String& typ e, const String& origin, const String& humanReadableName, const String& frameId) override;
106 void reportExecutionContextDestroyed(v8::Local<v8::Context>) override; 128 void reportExecutionContextDestroyed(v8::Local<v8::Context>) override;
107 PassRefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails> createException Details(v8::Isolate*, v8::Local<v8::Message>); 129 PassOwnPtr<protocol::Runtime::ExceptionDetails> createExceptionDetails(v8::I solate*, v8::Local<v8::Message>);
108 130
109 RefPtr<JSONObject> m_state; 131 RefPtr<JSONObject> m_state;
110 protocol::Frontend::Runtime* m_frontend; 132 protocol::Frontend::Runtime* m_frontend;
111 OwnPtr<InjectedScriptManager> m_injectedScriptManager; 133 OwnPtr<InjectedScriptManager> m_injectedScriptManager;
112 V8DebuggerImpl* m_debugger; 134 V8DebuggerImpl* m_debugger;
113 bool m_enabled; 135 bool m_enabled;
114 HashMap<String, OwnPtr<v8::Global<v8::Script>>> m_compiledScripts; 136 HashMap<String, OwnPtr<v8::Global<v8::Script>>> m_compiledScripts;
115 }; 137 };
116 138
117 } // namespace blink 139 } // namespace blink
118 140
119 #endif // V8RuntimeAgentImpl_h 141 #endif // V8RuntimeAgentImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698