Index: content/browser/devtools/protocol/io_handler.cc |
diff --git a/content/browser/devtools/protocol/io_handler.cc b/content/browser/devtools/protocol/io_handler.cc |
index 1cc1354cda7d611be66862cd67e078adfa410a21..e21e1d2605d1d78812e59d6bc63d489b2a7efc50 100644 |
--- a/content/browser/devtools/protocol/io_handler.cc |
+++ b/content/browser/devtools/protocol/io_handler.cc |
@@ -31,8 +31,11 @@ void IOHandler::SetClient(scoped_ptr<Client> client) { |
client_.swap(client); |
} |
-Response IOHandler::Read(DevToolsCommandId command_id, |
- const std::string& handle, const int* offset, const int* max_size) { |
+Response IOHandler::Read(int session_id, |
+ DevToolsCommandId command_id, |
+ const std::string& handle, |
+ const int* offset, |
+ const int* max_size) { |
static const size_t kDefaultChunkSize = 10 * 1024 * 1024; |
scoped_refptr<DevToolsIOContext::Stream> stream = |
@@ -41,20 +44,23 @@ Response IOHandler::Read(DevToolsCommandId command_id, |
return Response::InvalidParams("Invalid stream handle"); |
stream->Read(offset ? *offset : -1, |
max_size && *max_size ? *max_size : kDefaultChunkSize, |
- base::Bind(&IOHandler::ReadComplete, |
- weak_factory_.GetWeakPtr(), command_id)); |
+ base::Bind(&IOHandler::ReadComplete, weak_factory_.GetWeakPtr(), |
+ session_id, command_id)); |
return Response::OK(); |
} |
-void IOHandler::ReadComplete(DevToolsCommandId command_id, |
+void IOHandler::ReadComplete(int session_id, |
+ DevToolsCommandId command_id, |
const scoped_refptr<base::RefCountedString>& data, |
int status) { |
if (status == DevToolsIOContext::Stream::StatusFailure) { |
- client_->SendError(command_id, Response::ServerError("Read failed")); |
+ client_->SendError(session_id, command_id, |
+ Response::ServerError("Read failed")); |
return; |
} |
bool eof = status == DevToolsIOContext::Stream::StatusEOF; |
- client_->SendReadResponse(command_id, |
+ client_->SendReadResponse( |
+ session_id, command_id, |
ReadResponse::Create()->set_data(data->data())->set_eof(eof)); |
} |