Commit d3d86f52 authored by Anand K. Mistry's avatar Anand K. Mistry Committed by Commit Bot

[Extensions Functions] Migrate debugger API to ExtensionFunction

Bug: 634140
Change-Id: I38b8ad3ec7c01c2dedbb65281d7d4541bd553688
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078371
Commit-Queue: Anand Mistry <amistry@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746576}
parent 6b639f6c
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/common/extensions/api/debugger.h" #include "chrome/common/extensions/api/debugger.h"
#include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_agent_host.h"
#include "extensions/browser/extension_function.h"
using extensions::api::debugger::Debuggee; using extensions::api::debugger::Debuggee;
...@@ -26,15 +26,15 @@ class DictionaryValue; ...@@ -26,15 +26,15 @@ class DictionaryValue;
namespace extensions { namespace extensions {
class ExtensionDevToolsClientHost; class ExtensionDevToolsClientHost;
class DebuggerFunction : public ChromeAsyncExtensionFunction { class DebuggerFunction : public ExtensionFunction {
protected: protected:
DebuggerFunction(); DebuggerFunction();
~DebuggerFunction() override; ~DebuggerFunction() override;
void FormatErrorMessage(const std::string& format); std::string FormatErrorMessage(const std::string& format);
bool InitAgentHost(); bool InitAgentHost(std::string* error);
bool InitClientHost(); bool InitClientHost(std::string* error);
ExtensionDevToolsClientHost* FindClientHost(); ExtensionDevToolsClientHost* FindClientHost();
Debuggee debuggee_; Debuggee debuggee_;
...@@ -53,7 +53,7 @@ class DebuggerAttachFunction : public DebuggerFunction { ...@@ -53,7 +53,7 @@ class DebuggerAttachFunction : public DebuggerFunction {
~DebuggerAttachFunction() override; ~DebuggerAttachFunction() override;
// ExtensionFunction: // ExtensionFunction:
bool RunAsync() override; ResponseAction Run() override;
}; };
// Implements the debugger.detach() extension function. // Implements the debugger.detach() extension function.
...@@ -67,7 +67,7 @@ class DebuggerDetachFunction : public DebuggerFunction { ...@@ -67,7 +67,7 @@ class DebuggerDetachFunction : public DebuggerFunction {
~DebuggerDetachFunction() override; ~DebuggerDetachFunction() override;
// ExtensionFunction: // ExtensionFunction:
bool RunAsync() override; ResponseAction Run() override;
}; };
// Implements the debugger.sendCommand() extension function. // Implements the debugger.sendCommand() extension function.
...@@ -83,7 +83,7 @@ class DebuggerSendCommandFunction : public DebuggerFunction { ...@@ -83,7 +83,7 @@ class DebuggerSendCommandFunction : public DebuggerFunction {
~DebuggerSendCommandFunction() override; ~DebuggerSendCommandFunction() override;
// ExtensionFunction: // ExtensionFunction:
bool RunAsync() override; ResponseAction Run() override;
}; };
// Implements the debugger.getTargets() extension function. // Implements the debugger.getTargets() extension function.
...@@ -97,10 +97,7 @@ class DebuggerGetTargetsFunction : public DebuggerFunction { ...@@ -97,10 +97,7 @@ class DebuggerGetTargetsFunction : public DebuggerFunction {
~DebuggerGetTargetsFunction() override; ~DebuggerGetTargetsFunction() override;
// ExtensionFunction: // ExtensionFunction:
bool RunAsync() override; ResponseAction Run() override;
private:
void SendTargetList(const content::DevToolsAgentHost::List& target_list);
}; };
} // namespace extensions } // namespace extensions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment