Index: components/offline_pages/core/prefetch/prefetch_proto_utils.cc |
diff --git a/components/offline_pages/core/prefetch/prefetch_proto_utils.cc b/components/offline_pages/core/prefetch/prefetch_proto_utils.cc |
index 0fe504049bc45368c1e3c5e567e40727b7f53fbb..0fcdfb7beb293c8f586061099103ee11e189d635 100644 |
--- a/components/offline_pages/core/prefetch/prefetch_proto_utils.cc |
+++ b/components/offline_pages/core/prefetch/prefetch_proto_utils.cc |
@@ -123,18 +123,19 @@ bool ParsePendingOperationResponse(const proto::Operation& operation, |
} // namespace |
-bool ParseOperationResponse(const std::string& data, |
- std::vector<RenderPageInfo>* pages) { |
+std::string ParseOperationResponse(const std::string& data, |
+ std::vector<RenderPageInfo>* pages) { |
proto::Operation operation; |
if (!operation.ParseFromString(data)) { |
DVLOG(1) << "Failed to parse operation"; |
- return false; |
+ return std::string(); |
} |
- if (operation.done()) |
- return ParseDoneOperationResponse(operation, pages); |
- else |
- return ParsePendingOperationResponse(operation, pages); |
+ std::string name = operation.name(); |
+ bool success = operation.done() |
+ ? ParseDoneOperationResponse(operation, pages) |
+ : ParsePendingOperationResponse(operation, pages); |
+ return success ? name : std::string(); |
} |
} // namespace offline_pages |