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

Unified Diff: content/browser/devtools/devtools_protocol_handler.cc

Issue 2500093002: [DevTools] Move IO and Tracing to new generator. (Closed)
Patch Set: roll 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 | « content/browser/devtools/devtools_protocol_handler.h ('k') | content/browser/devtools/devtools_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/devtools_protocol_handler.cc
diff --git a/content/browser/devtools/devtools_protocol_handler.cc b/content/browser/devtools/devtools_protocol_handler.cc
index be689d43acf888a6a9797e41b6ecdaa04dd95d3e..e7dc2ecaef0b26bb41a256a97965e3b7faf4fcf9 100644
--- a/content/browser/devtools/devtools_protocol_handler.cc
+++ b/content/browser/devtools/devtools_protocol_handler.cc
@@ -7,9 +7,9 @@
#include <utility>
#include "base/bind.h"
-#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
+#include "base/values.h"
#include "content/browser/devtools/devtools_agent_host_impl.h"
#include "content/browser/devtools/devtools_manager.h"
#include "content/public/browser/devtools_manager_delegate.h"
@@ -47,10 +47,11 @@ DevToolsProtocolHandler::DevToolsProtocolHandler(
DevToolsProtocolHandler::~DevToolsProtocolHandler() {
}
-void DevToolsProtocolHandler::HandleMessage(int session_id,
- const std::string& message) {
+void DevToolsProtocolHandler::HandleMessage(
+ int session_id,
+ std::unique_ptr<base::Value> message) {
std::unique_ptr<base::DictionaryValue> command =
- ParseCommand(session_id, message);
+ ParseCommand(session_id, std::move(message));
if (!command)
return;
if (PassCommandToDelegate(session_id, command.get()))
@@ -58,12 +59,13 @@ void DevToolsProtocolHandler::HandleMessage(int session_id,
HandleCommand(session_id, std::move(command));
}
-bool DevToolsProtocolHandler::HandleOptionalMessage(int session_id,
- const std::string& message,
- int* call_id,
- std::string* method) {
+bool DevToolsProtocolHandler::HandleOptionalMessage(
+ int session_id,
+ std::unique_ptr<base::Value> message,
+ int* call_id,
+ std::string* method) {
std::unique_ptr<base::DictionaryValue> command =
- ParseCommand(session_id, message);
+ ParseCommand(session_id, std::move(message));
if (!command)
return true;
if (PassCommandToDelegate(session_id, command.get()))
@@ -91,8 +93,7 @@ bool DevToolsProtocolHandler::PassCommandToDelegate(
std::unique_ptr<base::DictionaryValue> DevToolsProtocolHandler::ParseCommand(
int session_id,
- const std::string& message) {
- std::unique_ptr<base::Value> value = base::JSONReader::Read(message);
+ std::unique_ptr<base::Value> value) {
if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) {
client_.SendError(
DevToolsCommandId(DevToolsCommandId::kNoId, session_id),
« no previous file with comments | « content/browser/devtools/devtools_protocol_handler.h ('k') | content/browser/devtools/devtools_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698