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

Unified Diff: components/offline_pages/core/prefetch/get_operation_request.cc

Issue 2928243002: Return operation name in prefetch request callback and add internal page hookup (Closed)
Patch Set: Fix comment indent in JS Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/prefetch/get_operation_request.cc
diff --git a/components/offline_pages/core/prefetch/get_operation_request.cc b/components/offline_pages/core/prefetch/get_operation_request.cc
index 59865ffcd8c647026fba82468534e6180af2b465..77d2cd21873e03ed64f590eb89959b7278ebeb2f 100644
--- a/components/offline_pages/core/prefetch/get_operation_request.cc
+++ b/components/offline_pages/core/prefetch/get_operation_request.cc
@@ -15,7 +15,7 @@
namespace offline_pages {
namespace {
-const char kGetOperationURLPath[] = "v1/operations/";
+const char kGetOperationURLPath[] = "v1/";
} // namespace
GetOperationRequest::GetOperationRequest(
@@ -38,18 +38,19 @@ GetOperationRequest::~GetOperationRequest() {}
void GetOperationRequest::OnCompleted(PrefetchRequestStatus status,
const std::string& data) {
if (status != PrefetchRequestStatus::SUCCESS) {
- callback_.Run(status, std::vector<RenderPageInfo>());
+ callback_.Run(status, std::string(), std::vector<RenderPageInfo>());
return;
}
std::vector<RenderPageInfo> pages;
- if (!ParseOperationResponse(data, &pages)) {
+ std::string operation_name = ParseOperationResponse(data, &pages);
+ if (operation_name.empty()) {
callback_.Run(PrefetchRequestStatus::SHOULD_RETRY_WITH_BACKOFF,
- std::vector<RenderPageInfo>());
+ std::string(), std::vector<RenderPageInfo>());
return;
}
- callback_.Run(PrefetchRequestStatus::SUCCESS, pages);
+ callback_.Run(PrefetchRequestStatus::SUCCESS, operation_name, pages);
}
} // offline_pages

Powered by Google App Engine
This is Rietveld 408576698