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

Unified Diff: src/inspector/injected-script.h

Issue 2467853003: [inspector] migrate Runtime to new style (Closed)
Patch Set: addressed comments Created 4 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
« no previous file with comments | « no previous file | src/inspector/injected-script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/injected-script.h
diff --git a/src/inspector/injected-script.h b/src/inspector/injected-script.h
index bec261240da08511e5f057afa62b05da8ce59f61..6500f4dbb735977e69a8218a12c4e65e156963a2 100644
--- a/src/inspector/injected-script.h
+++ b/src/inspector/injected-script.h
@@ -48,8 +48,8 @@ class V8FunctionCall;
class V8InspectorImpl;
class V8InspectorSessionImpl;
-using protocol::ErrorString;
using protocol::Maybe;
+using protocol::Response;
class InjectedScript final {
public:
@@ -58,56 +58,51 @@ class InjectedScript final {
InspectedContext* context() const { return m_context; }
- void getProperties(
- ErrorString*, v8::Local<v8::Object>, const String16& groupName,
- bool ownProperties, bool accessorPropertiesOnly, bool generatePreview,
+ Response getProperties(
+ v8::Local<v8::Object>, const String16& groupName, bool ownProperties,
+ bool accessorPropertiesOnly, bool generatePreview,
std::unique_ptr<protocol::Array<protocol::Runtime::PropertyDescriptor>>*
result,
Maybe<protocol::Runtime::ExceptionDetails>*);
void releaseObject(const String16& objectId);
- std::unique_ptr<protocol::Runtime::RemoteObject> wrapObject(
- ErrorString*, v8::Local<v8::Value>, const String16& groupName,
- bool forceValueType = false, bool generatePreview = false) const;
- bool wrapObjectProperty(ErrorString*, v8::Local<v8::Object>,
- v8::Local<v8::Name> key, const String16& groupName,
- bool forceValueType = false,
- bool generatePreview = false) const;
- bool wrapPropertyInArray(ErrorString*, v8::Local<v8::Array>,
- v8::Local<v8::String> property,
- const String16& groupName,
- bool forceValueType = false,
- bool generatePreview = false) const;
- bool wrapObjectsInArray(ErrorString*, v8::Local<v8::Array>,
- const String16& groupName,
- bool forceValueType = false,
- bool generatePreview = false) const;
+ Response wrapObject(
+ v8::Local<v8::Value>, const String16& groupName, bool forceValueType,
+ bool generatePreview,
+ std::unique_ptr<protocol::Runtime::RemoteObject>* result) const;
+ Response wrapObjectProperty(v8::Local<v8::Object>, v8::Local<v8::Name> key,
+ const String16& groupName,
+ bool forceValueType = false,
+ bool generatePreview = false) const;
+ Response wrapPropertyInArray(v8::Local<v8::Array>,
+ v8::Local<v8::String> property,
+ const String16& groupName,
+ bool forceValueType = false,
+ bool generatePreview = false) const;
std::unique_ptr<protocol::Runtime::RemoteObject> wrapTable(
v8::Local<v8::Value> table, v8::Local<v8::Value> columns) const;
- bool findObject(ErrorString*, const RemoteObjectId&,
- v8::Local<v8::Value>*) const;
+ Response findObject(const RemoteObjectId&, v8::Local<v8::Value>*) const;
String16 objectGroupName(const RemoteObjectId&) const;
void releaseObjectGroup(const String16&);
void setCustomObjectFormatterEnabled(bool);
- v8::MaybeLocal<v8::Value> resolveCallArgument(
- ErrorString*, protocol::Runtime::CallArgument*);
-
- std::unique_ptr<protocol::Runtime::ExceptionDetails> createExceptionDetails(
- ErrorString*, const v8::TryCatch&, const String16& groupName,
- bool generatePreview);
- void wrapEvaluateResult(
- ErrorString*, v8::MaybeLocal<v8::Value> maybeResultValue,
- const v8::TryCatch&, const String16& objectGroup, bool returnByValue,
- bool generatePreview,
+ Response resolveCallArgument(protocol::Runtime::CallArgument*,
+ v8::Local<v8::Value>* result);
+
+ Response createExceptionDetails(
+ const v8::TryCatch&, const String16& groupName, bool generatePreview,
+ Maybe<protocol::Runtime::ExceptionDetails>* result);
+ Response wrapEvaluateResult(
+ v8::MaybeLocal<v8::Value> maybeResultValue, const v8::TryCatch&,
+ const String16& objectGroup, bool returnByValue, bool generatePreview,
std::unique_ptr<protocol::Runtime::RemoteObject>* result,
Maybe<protocol::Runtime::ExceptionDetails>*);
v8::Local<v8::Value> lastEvaluationResult() const;
class Scope {
public:
- bool initialize();
- bool installCommandLineAPI();
+ Response initialize();
+ void installCommandLineAPI();
void ignoreExceptionsAndMuteConsole();
void pretendUserGesture();
v8::Local<v8::Context> context() const { return m_context; }
@@ -115,11 +110,10 @@ class InjectedScript final {
const v8::TryCatch& tryCatch() const { return m_tryCatch; }
protected:
- Scope(ErrorString*, V8InspectorImpl*, int contextGroupId);
+ Scope(V8InspectorImpl*, int contextGroupId);
virtual ~Scope();
- virtual void findInjectedScript(V8InspectorSessionImpl*) = 0;
+ virtual Response findInjectedScript(V8InspectorSessionImpl*) = 0;
- ErrorString* m_errorString;
V8InspectorImpl* m_inspector;
int m_contextGroupId;
InjectedScript* m_injectedScript;
@@ -140,12 +134,11 @@ class InjectedScript final {
class ContextScope : public Scope {
public:
- ContextScope(ErrorString*, V8InspectorImpl*, int contextGroupId,
- int executionContextId);
+ ContextScope(V8InspectorImpl*, int contextGroupId, int executionContextId);
~ContextScope();
private:
- void findInjectedScript(V8InspectorSessionImpl*) override;
+ Response findInjectedScript(V8InspectorSessionImpl*) override;
int m_executionContextId;
DISALLOW_COPY_AND_ASSIGN(ContextScope);
@@ -153,14 +146,14 @@ class InjectedScript final {
class ObjectScope : public Scope {
public:
- ObjectScope(ErrorString*, V8InspectorImpl*, int contextGroupId,
+ ObjectScope(V8InspectorImpl*, int contextGroupId,
const String16& remoteObjectId);
~ObjectScope();
const String16& objectGroupName() const { return m_objectGroupName; }
v8::Local<v8::Value> object() const { return m_object; }
private:
- void findInjectedScript(V8InspectorSessionImpl*) override;
+ Response findInjectedScript(V8InspectorSessionImpl*) override;
String16 m_remoteObjectId;
String16 m_objectGroupName;
v8::Local<v8::Value> m_object;
@@ -170,13 +163,13 @@ class InjectedScript final {
class CallFrameScope : public Scope {
public:
- CallFrameScope(ErrorString*, V8InspectorImpl*, int contextGroupId,
+ CallFrameScope(V8InspectorImpl*, int contextGroupId,
const String16& remoteCallFrameId);
~CallFrameScope();
size_t frameOrdinal() const { return m_frameOrdinal; }
private:
- void findInjectedScript(V8InspectorSessionImpl*) override;
+ Response findInjectedScript(V8InspectorSessionImpl*) override;
String16 m_remoteCallFrameId;
size_t m_frameOrdinal;
@@ -187,10 +180,9 @@ class InjectedScript final {
InjectedScript(InspectedContext*, v8::Local<v8::Object>,
std::unique_ptr<InjectedScriptNative>);
v8::Local<v8::Value> v8Value() const;
- v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>,
- const String16& groupName,
- bool forceValueType,
- bool generatePreview) const;
+ Response wrapValue(v8::Local<v8::Value>, const String16& groupName,
+ bool forceValueType, bool generatePreview,
+ v8::Local<v8::Value>* result) const;
v8::Local<v8::Object> commandLineAPI();
InspectedContext* m_context;
« no previous file with comments | « no previous file | src/inspector/injected-script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698