Index: components/offline_pages/core/prefetch/add_unique_urls_task.h |
diff --git a/components/offline_pages/core/prefetch/add_unique_urls_task.h b/components/offline_pages/core/prefetch/add_unique_urls_task.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f4ee6ead9d07ab69e76a41faec904de7e1148567 |
--- /dev/null |
+++ b/components/offline_pages/core/prefetch/add_unique_urls_task.h |
@@ -0,0 +1,43 @@ |
+// 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_ADD_UNIQUE_URLS_TASK_H_ |
+#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_ADD_UNIQUE_URLS_TASK_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "components/offline_pages/core/prefetch/prefetch_store.h" |
+#include "components/offline_pages/core/prefetch/prefetch_types.h" |
+#include "components/offline_pages/core/task.h" |
+#include "url/gurl.h" |
+ |
+namespace offline_pages { |
+ |
+// Task that adds new URL suggestions to the pipeline. URLs are matched against |
+// existing ones from any stage of the process so that only new, unique ones are |
+// actually added. Once that's done, URLs in the ZOMBIE state that didn't match |
+// any of the suggestions for the same namespace are deleted from the store. |
Dmitry Titov
2017/05/18 21:24:02
Could you please add a sentence here explaining to
carlosk
2017/05/24 20:57:26
Done.
|
+class AddUniqueUrlsTask : public Task { |
+ public: |
+ AddUniqueUrlsTask(PrefetchStore* store, |
+ const std::string& name_space, |
+ const std::vector<PrefetchURL>& prefetch_urls); |
+ ~AddUniqueUrlsTask() override; |
+ |
+ void Run() override; |
+ |
+ private: |
+ PrefetchStore* store_; |
+ std::string name_space_; |
+ std::vector<PrefetchURL> prefetch_urls_; |
+ |
+ base::WeakPtrFactory<AddUniqueUrlsTask> weak_ptr_factory_; |
+ DISALLOW_COPY_AND_ASSIGN(AddUniqueUrlsTask); |
+}; |
+ |
+} // namespace offline_pages |
+ |
+#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_ADD_UNIQUE_URLS_TASK_H_ |