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

Unified Diff: chrome/browser/android/offline_pages/prerendering_offliner_factory.h

Issue 1929223002: Add skeletons for the factories to create the request coordinator and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt gypi file fix. Created 4 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: chrome/browser/android/offline_pages/prerendering_offliner_factory.h
diff --git a/chrome/browser/android/offline_pages/prerendering_offliner_factory.h b/chrome/browser/android/offline_pages/prerendering_offliner_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..f2adb78d6f402de25cbe1bb3f0c96e6ab4c3dcdf
--- /dev/null
+++ b/chrome/browser/android/offline_pages/prerendering_offliner_factory.h
@@ -0,0 +1,45 @@
+// Copyright 2016 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 CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_FACTORY_H_
+#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_FACTORY_H_
+
+#include "base/macros.h"
+#include "components/offline_pages/background/offliner_factory.h"
+
+namespace content {
+class BrowserContext;
+} // namespace content
+
+namespace offline_pages {
+
+class OfflinerPolicy;
+class Offliner;
+class PrerenderingOffliner;
+
+// A factory to create one unique PrerenderingOffliner. Since the
+// PrerenderingOffliner is somewhat heavyweight and can use lots of memory, we
+// normally don't want more than one, and we can reuse the offliner for many
+// offlining sessions.
+class PrerenderingOfflinerFactory : public OfflinerFactory {
+ public:
+ explicit PrerenderingOfflinerFactory(content::BrowserContext* context);
+ ~PrerenderingOfflinerFactory() override;
+
+ Offliner* GetOffliner(const OfflinerPolicy* policy) override;
+
+ private:
+ // The offliner is owned by the factory, since it may be resued.
+ PrerenderingOffliner* offliner_;
+
+ // This is an unowned pointer, expected to stay valid for the lifetime of the
+ // factory.
+ content::BrowserContext* context_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrerenderingOfflinerFactory);
+};
+
+} // namespace offline_pages
+
+#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_OFFLINER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698