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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorRuntimeAgent.h

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing 2 Created 4 years, 9 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 30 matching lines...) Expand all
41 41
42 class InjectedScript; 42 class InjectedScript;
43 class InjectedScriptManager; 43 class InjectedScriptManager;
44 class ScriptState; 44 class ScriptState;
45 class V8Debugger; 45 class V8Debugger;
46 46
47 namespace protocol { 47 namespace protocol {
48 class ListValue; 48 class ListValue;
49 } 49 }
50 50
51 typedef String ErrorString;
52
53 using protocol::Maybe; 51 using protocol::Maybe;
54 52
55 class CORE_EXPORT InspectorRuntimeAgent 53 class CORE_EXPORT InspectorRuntimeAgent
56 : public InspectorBaseAgent<InspectorRuntimeAgent, protocol::Frontend::Runti me> 54 : public InspectorBaseAgent<InspectorRuntimeAgent, protocol::Frontend::Runti me>
57 , public protocol::Dispatcher::RuntimeCommandHandler 55 , public protocol::Dispatcher::RuntimeCommandHandler
58 , public V8RuntimeAgent::Client { 56 , public V8RuntimeAgent::Client {
59 WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent); 57 WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent);
60 public: 58 public:
61 class Client { 59 class Client {
62 public: 60 public:
63 virtual ~Client() { } 61 virtual ~Client() { }
64 62
65 virtual void resumeStartup() { } 63 virtual void resumeStartup() { }
66 }; 64 };
67 65
68 ~InspectorRuntimeAgent() override; 66 ~InspectorRuntimeAgent() override;
69 67
70 // V8RuntimeAgent::Client. 68 // V8RuntimeAgent::Client.
71 void reportExecutionContexts() override { } 69 void reportExecutionContexts() override { }
72 70
73 // InspectorBaseAgent overrides. 71 // InspectorBaseAgent overrides.
74 void setState(protocol::DictionaryValue*) override; 72 void setState(protocol::DictionaryValue*) override;
75 void setFrontend(protocol::Frontend*) override; 73 void setFrontend(protocol::Frontend*) override;
76 void clearFrontend() override; 74 void clearFrontend() override;
77 void restore() override; 75 void restore() override;
78 76
79 // Part of the protocol. 77 // Part of the protocol.
80 void evaluate(ErrorString*, const String& expression, const Maybe<String>& o bjectGroup, const Maybe<bool>& includeCommandLineAPI, const Maybe<bool>& doNotPa useOnExceptionsAndMuteConsole, const Maybe<int>& contextId, const Maybe<bool>& r eturnByValue, const Maybe<bool>& generatePreview, OwnPtr<protocol::Runtime::Remo teObject>* result, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::ExceptionDet ails>*) override; 78 void evaluate(ErrorString*, const String16& expression, const Maybe<String16 >& objectGroup, const Maybe<bool>& includeCommandLineAPI, const Maybe<bool>& doN otPauseOnExceptionsAndMuteConsole, const Maybe<int>& contextId, const Maybe<bool >& returnByValue, const Maybe<bool>& generatePreview, OwnPtr<protocol::Runtime:: RemoteObject>* result, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::Exceptio nDetails>*) override;
81 void callFunctionOn(ErrorString*, const String& objectId, const String& func tionDeclaration, const Maybe<protocol::Array<protocol::Runtime::CallArgument>>& arguments, const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole, const Maybe< bool>& returnByValue, const Maybe<bool>& generatePreview, OwnPtr<protocol::Runti me::RemoteObject>* result, Maybe<bool>* wasThrown) override; 79 void callFunctionOn(ErrorString*, const String16& objectId, const String16& functionDeclaration, const Maybe<protocol::Array<protocol::Runtime::CallArgument >>& arguments, const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole, const Ma ybe<bool>& returnByValue, const Maybe<bool>& generatePreview, OwnPtr<protocol::R untime::RemoteObject>* result, Maybe<bool>* wasThrown) override;
82 void getProperties(ErrorString*, const String& objectId, const Maybe<bool>& ownProperties, const Maybe<bool>& accessorPropertiesOnly, const Maybe<bool>& gen eratePreview, OwnPtr<protocol::Array<protocol::Runtime::PropertyDescriptor>>* re sult, Maybe<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* int ernalProperties, Maybe<protocol::Runtime::ExceptionDetails>*) override; 80 void getProperties(ErrorString*, const String16& objectId, const Maybe<bool> & ownProperties, const Maybe<bool>& accessorPropertiesOnly, const Maybe<bool>& g eneratePreview, OwnPtr<protocol::Array<protocol::Runtime::PropertyDescriptor>>* result, Maybe<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* i nternalProperties, Maybe<protocol::Runtime::ExceptionDetails>*) override;
83 void releaseObject(ErrorString*, const String& objectId) override; 81 void releaseObject(ErrorString*, const String16& objectId) override;
84 void releaseObjectGroup(ErrorString*, const String& objectGroup) override; 82 void releaseObjectGroup(ErrorString*, const String16& objectGroup) override;
85 void run(ErrorString*) override; 83 void run(ErrorString*) override;
86 void enable(ErrorString*) override; 84 void enable(ErrorString*) override;
87 void disable(ErrorString*) override; 85 void disable(ErrorString*) override;
88 void setCustomObjectFormatterEnabled(ErrorString*, bool enabled) override; 86 void setCustomObjectFormatterEnabled(ErrorString*, bool enabled) override;
89 void compileScript(ErrorString*, const String& expression, const String& sou rceURL, bool persistScript, int executionContextId, Maybe<String>* scriptId, May be<protocol::Runtime::ExceptionDetails>*) override; 87 void compileScript(ErrorString*, const String16& expression, const String16& sourceURL, bool persistScript, int executionContextId, Maybe<String16>* scriptI d, Maybe<protocol::Runtime::ExceptionDetails>*) override;
90 void runScript(ErrorString*, const String& scriptId, int executionContextId, const Maybe<String>& objectGroup, const Maybe<bool>& doNotPauseOnExceptionsAndM uteConsole, const Maybe<bool>& includeCommandLineAPI, OwnPtr<protocol::Runtime:: RemoteObject>* result, Maybe<protocol::Runtime::ExceptionDetails>*) override; 88 void runScript(ErrorString*, const String16& scriptId, int executionContextI d, const Maybe<String16>& objectGroup, const Maybe<bool>& doNotPauseOnExceptions AndMuteConsole, const Maybe<bool>& includeCommandLineAPI, OwnPtr<protocol::Runti me::RemoteObject>* result, Maybe<protocol::Runtime::ExceptionDetails>*) override ;
91 89
92 virtual void muteConsole() = 0; 90 virtual void muteConsole() = 0;
93 virtual void unmuteConsole() = 0; 91 virtual void unmuteConsole() = 0;
94 92
95 V8RuntimeAgent* v8Agent() { return m_v8RuntimeAgent.get(); } 93 V8RuntimeAgent* v8Agent() { return m_v8RuntimeAgent.get(); }
96 94
97 protected: 95 protected:
98 InspectorRuntimeAgent(V8Debugger*, Client*); 96 InspectorRuntimeAgent(V8Debugger*, Client*);
99 virtual ScriptState* defaultScriptState() = 0; 97 virtual ScriptState* defaultScriptState() = 0;
100 98
101 void reportExecutionContextCreated(ScriptState*, const String& type, const S tring& origin, const String& humanReadableName, const String& frameId); 99 void reportExecutionContextCreated(ScriptState*, const String16& type, const String16& origin, const String16& humanReadableName, const String16& frameId);
102 void reportExecutionContextDestroyed(ScriptState*); 100 void reportExecutionContextDestroyed(ScriptState*);
103 101
104 bool m_enabled; 102 bool m_enabled;
105 OwnPtr<V8RuntimeAgent> m_v8RuntimeAgent; 103 OwnPtr<V8RuntimeAgent> m_v8RuntimeAgent;
106 Client* m_client; 104 Client* m_client;
107 }; 105 };
108 106
109 } // namespace blink 107 } // namespace blink
110 108
111 #endif // InspectorRuntimeAgent_h 109 #endif // InspectorRuntimeAgent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698