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

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

Issue 1730383003: DevTools: consistently use Maybe for optional values in the protocol generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed 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; 47 using protocol::Maybe;
48 48
49 class V8RuntimeAgentImpl : public V8RuntimeAgent { 49 class V8RuntimeAgentImpl : public V8RuntimeAgent {
50 WTF_MAKE_NONCOPYABLE(V8RuntimeAgentImpl); 50 WTF_MAKE_NONCOPYABLE(V8RuntimeAgentImpl);
51 public: 51 public:
52 V8RuntimeAgentImpl(V8DebuggerImpl*); 52 V8RuntimeAgentImpl(V8DebuggerImpl*);
53 ~V8RuntimeAgentImpl() override; 53 ~V8RuntimeAgentImpl() override;
54 54
55 // State management methods. 55 // State management methods.
56 void setInspectorState(PassRefPtr<JSONObject>) override; 56 void setInspectorState(PassRefPtr<JSONObject>) override;
57 void setFrontend(protocol::Frontend::Runtime*) override; 57 void setFrontend(protocol::Frontend::Runtime*) override;
58 void clearFrontend() override; 58 void clearFrontend() override;
59 void restore() override; 59 void restore() override;
60 60
61 // Part of the protocol. 61 // Part of the protocol.
62 void enable(ErrorString*) override; 62 void enable(ErrorString*) override;
63 void disable(ErrorString*) override; 63 void disable(ErrorString*) override;
64 void evaluate(ErrorString*, 64 void evaluate(ErrorString*,
65 const String& expression, 65 const String& expression,
66 const OptionalValue<String>& objectGroup, 66 const Maybe<String>& objectGroup,
67 const OptionalValue<bool>& includeCommandLineAPI, 67 const Maybe<bool>& includeCommandLineAPI,
68 const OptionalValue<bool>& doNotPauseOnExceptionsAndMuteConsole, 68 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole,
69 const OptionalValue<int>& executionContextId, 69 const Maybe<int>& executionContextId,
70 const OptionalValue<bool>& returnByValue, 70 const Maybe<bool>& returnByValue,
71 const OptionalValue<bool>& generatePreview, 71 const Maybe<bool>& generatePreview,
72 OwnPtr<protocol::Runtime::RemoteObject>* result, 72 OwnPtr<protocol::Runtime::RemoteObject>* result,
73 OptionalValue<bool>* wasThrown, 73 Maybe<bool>* wasThrown,
74 OwnPtr<protocol::Runtime::ExceptionDetails>*) override; 74 Maybe<protocol::Runtime::ExceptionDetails>*) override;
75 void callFunctionOn(ErrorString*, 75 void callFunctionOn(ErrorString*,
76 const String& objectId, 76 const String& objectId,
77 const String& expression, 77 const String& expression,
78 PassOwnPtr<protocol::Array<protocol::Runtime::CallArgument>> optionalArg uments, 78 const Maybe<protocol::Array<protocol::Runtime::CallArgument>>& optionalA rguments,
79 const OptionalValue<bool>& doNotPauseOnExceptionsAndMuteConsole, 79 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole,
80 const OptionalValue<bool>& returnByValue, 80 const Maybe<bool>& returnByValue,
81 const OptionalValue<bool>& generatePreview, 81 const Maybe<bool>& generatePreview,
82 OwnPtr<protocol::Runtime::RemoteObject>* result, 82 OwnPtr<protocol::Runtime::RemoteObject>* result,
83 OptionalValue<bool>* wasThrown) override; 83 Maybe<bool>* wasThrown) override;
84 void releaseObject(ErrorString*, const String& objectId) override; 84 void releaseObject(ErrorString*, const String& objectId) override;
85 void getProperties(ErrorString*, 85 void getProperties(ErrorString*,
86 const String& objectId, 86 const String& objectId,
87 const OptionalValue<bool>& ownProperties, 87 const Maybe<bool>& ownProperties,
88 const OptionalValue<bool>& accessorPropertiesOnly, 88 const Maybe<bool>& accessorPropertiesOnly,
89 const OptionalValue<bool>& generatePreview, 89 const Maybe<bool>& generatePreview,
90 OwnPtr<protocol::Array<protocol::Runtime::PropertyDescriptor>>* result, 90 OwnPtr<protocol::Array<protocol::Runtime::PropertyDescriptor>>* result,
91 OwnPtr<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* internalProperties, 91 Maybe<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* i nternalProperties,
92 OwnPtr<protocol::Runtime::ExceptionDetails>*) override; 92 Maybe<protocol::Runtime::ExceptionDetails>*) override;
93 void releaseObjectGroup(ErrorString*, const String& objectGroup) override; 93 void releaseObjectGroup(ErrorString*, const String& objectGroup) override;
94 void run(ErrorString*) override; 94 void run(ErrorString*) override;
95 void isRunRequired(ErrorString*, bool* result) override; 95 void isRunRequired(ErrorString*, bool* result) override;
96 void setCustomObjectFormatterEnabled(ErrorString*, bool) override; 96 void setCustomObjectFormatterEnabled(ErrorString*, bool) override;
97 void compileScript(ErrorString*, 97 void compileScript(ErrorString*,
98 const String& expression, 98 const String& expression,
99 const String& sourceURL, 99 const String& sourceURL,
100 bool persistScript, 100 bool persistScript,
101 int executionContextId, 101 int executionContextId,
102 OptionalValue<protocol::Runtime::ScriptId>*, 102 Maybe<protocol::Runtime::ScriptId>*,
103 OwnPtr<protocol::Runtime::ExceptionDetails>*) override; 103 Maybe<protocol::Runtime::ExceptionDetails>*) override;
104 void runScript(ErrorString*, 104 void runScript(ErrorString*,
105 const protocol::Runtime::ScriptId&, 105 const protocol::Runtime::ScriptId&,
106 int executionContextId, 106 int executionContextId,
107 const OptionalValue<String>& objectGroup, 107 const Maybe<String>& objectGroup,
108 const OptionalValue<bool>& doNotPauseOnExceptionsAndMuteConsole, 108 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole,
109 const OptionalValue<bool>& includeCommandLineAPI, 109 const Maybe<bool>& includeCommandLineAPI,
110 OwnPtr<protocol::Runtime::RemoteObject>* result, 110 OwnPtr<protocol::Runtime::RemoteObject>* result,
111 OwnPtr<protocol::Runtime::ExceptionDetails>*) override; 111 Maybe<protocol::Runtime::ExceptionDetails>*) override;
112 112
113 V8DebuggerImpl* debugger() { return m_debugger; } 113 V8DebuggerImpl* debugger() { return m_debugger; }
114 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana ger.get(); } 114 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana ger.get(); }
115 115
116 private: 116 private:
117 void setClearConsoleCallback(PassOwnPtr<ClearConsoleCallback>) override; 117 void setClearConsoleCallback(PassOwnPtr<ClearConsoleCallback>) override;
118 void setInspectObjectCallback(PassOwnPtr<InspectCallback>) override; 118 void setInspectObjectCallback(PassOwnPtr<InspectCallback>) override;
119 int ensureDefaultContextAvailable(v8::Local<v8::Context>) override; 119 int ensureDefaultContextAvailable(v8::Local<v8::Context>) override;
120 PassOwnPtr<protocol::Runtime::RemoteObject> wrapObject(v8::Local<v8::Context >, v8::Local<v8::Value>, const String& groupName, bool generatePreview = false) override; 120 PassOwnPtr<protocol::Runtime::RemoteObject> wrapObject(v8::Local<v8::Context >, v8::Local<v8::Value>, const String& groupName, bool generatePreview = false) override;
121 PassOwnPtr<protocol::Runtime::RemoteObject> wrapTable(v8::Local<v8::Context> , v8::Local<v8::Value> table, v8::Local<v8::Value> columns) override; 121 PassOwnPtr<protocol::Runtime::RemoteObject> wrapTable(v8::Local<v8::Context> , v8::Local<v8::Value> table, v8::Local<v8::Value> columns) override;
(...skipping 10 matching lines...) Expand all
132 protocol::Frontend::Runtime* m_frontend; 132 protocol::Frontend::Runtime* m_frontend;
133 OwnPtr<InjectedScriptManager> m_injectedScriptManager; 133 OwnPtr<InjectedScriptManager> m_injectedScriptManager;
134 V8DebuggerImpl* m_debugger; 134 V8DebuggerImpl* m_debugger;
135 bool m_enabled; 135 bool m_enabled;
136 HashMap<String, OwnPtr<v8::Global<v8::Script>>> m_compiledScripts; 136 HashMap<String, OwnPtr<v8::Global<v8::Script>>> m_compiledScripts;
137 }; 137 };
138 138
139 } // namespace blink 139 } // namespace blink
140 140
141 #endif // V8RuntimeAgentImpl_h 141 #endif // V8RuntimeAgentImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698