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

Unified Diff: components/offline_pages/core/prefetch/prefetch_service.h

Issue 2811813002: [Offline Pages] Set up the initial prefetching service. (Closed)
Patch Set: Remove offline page model. Created 3 years, 8 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.h
diff --git a/components/offline_pages/core/prefetch/prefetch_service.h b/components/offline_pages/core/prefetch/prefetch_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..63c53e4ddf8b8c4d9f5ca17dd0ee363132dbb9ec
--- /dev/null
+++ b/components/offline_pages/core/prefetch/prefetch_service.h
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_
+#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_
+
+#include "components/keyed_service/core/keyed_service.h"
+
+class GURL;
+
+namespace offline_pages {
+
+// Main class for the Offline Pages Prefetching feature, which will ask a server
+// to package content from interesting URLs and send it to Chrome for
+// consumption while offline.
+class PrefetchService : public KeyedService {
Dmitry Titov 2017/04/11 21:50:46 As formulated, the service may only have a single
dewittj 2017/04/12 00:22:48 Done.
+ public:
+ ~PrefetchService() override = default;
+
+ // Called when a consumer has new URLs for the system to prefetch. Currently
+ // the only consumer is article suggestions.
Dmitry Titov 2017/04/11 21:50:46 can we just remove use of 'suggestions' and just u
dewittj 2017/04/12 00:22:48 Done.
+ virtual void OnNewURLsToPrefetch(std::vector<GURL> suggested_urls) = 0;
jianli 2017/04/11 22:39:55 nit: Please add const &.
dewittj 2017/04/12 00:22:48 Done.
+
+ // Called when all existing suggestions are no longer considered valid. The
+ // prefetch service should remove any suggestions that have not yet started
+ // downloading.
+ virtual void RemoveAllUnprocessedURLsToPrefetch() = 0;
jianli 2017/04/11 22:39:55 Since class name is PrefetchService, we can probab
dewittj 2017/04/12 00:22:49 I updated it to refer to the PrefetchURL struct in
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698