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

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

Issue 2864293003: [Offline Pages] Add a GCMAppHandler for offline page prefetch. (Closed)
Patch Set: Touch ups. Created 3 years, 7 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/prefetch_service_impl.cc
diff --git a/components/offline_pages/core/prefetch/prefetch_service_impl.cc b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
index 13f0eb3f40502706ad1a1fe7f2d6503c5f811f87..abdaffd548d4744960b65c83e7a827ef128b1971 100644
--- a/components/offline_pages/core/prefetch/prefetch_service_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
@@ -3,8 +3,42 @@
// found in the LICENSE file.
#include "components/offline_pages/core/prefetch/prefetch_service_impl.h"
+#include "components/gcm_driver/gcm_driver.h"
namespace offline_pages {
+namespace {
+const char kPrefetchingOfflinePagesAppId[] =
+ "com.google.chrome.OfflinePagePrefetch";
+}
+
+void PrefetchServiceImpl::PrefetchServiceAppHandler::ShutdownHandler() {}
+
+void PrefetchServiceImpl::PrefetchServiceAppHandler::OnStoreReset() {}
+
+void PrefetchServiceImpl::PrefetchServiceAppHandler::OnMessage(
+ const std::string& app_id,
+ const gcm::IncomingMessage& message) {
+ DVLOG(1) << "PrefetchServiceImpl " << __func__ << ":" << message.raw_data;
+}
+
+void PrefetchServiceImpl::PrefetchServiceAppHandler::OnMessagesDeleted(
+ const std::string& app_id) {
+ NOTIMPLEMENTED();
+}
+
+void PrefetchServiceImpl::PrefetchServiceAppHandler::OnSendError(
+ const std::string& app_id,
+ const gcm::GCMClient::SendErrorDetails& send_error_details) {
+ // We should never get here, since we are not sending GCM upstream.
+ NOTREACHED();
+}
+
+void PrefetchServiceImpl::PrefetchServiceAppHandler::OnSendAcknowledged(
+ const std::string& app_id,
+ const std::string& message_id) {
+ // We should never get here, since we are not sending GCM upstream.
+ NOTREACHED();
+}
PrefetchServiceImpl::PrefetchServiceImpl() {}
PrefetchServiceImpl::~PrefetchServiceImpl() = default;
@@ -32,6 +66,10 @@ void PrefetchServiceImpl::StopBackgroundTask(ScopedBackgroundTask* task) {
NOTIMPLEMENTED();
}
+void PrefetchServiceImpl::RegisterWithGCMDriver(gcm::GCMDriver* driver) {
+ driver->AddAppHandler(kPrefetchingOfflinePagesAppId, &app_handler_);
Dmitry Titov 2017/05/11 03:35:20 If you do this in the GCMProfileServiceFactory, yo
+}
+
void PrefetchServiceImpl::Shutdown() {}
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698