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

Side by Side Diff: chrome/browser/android/offline_pages/request_coordinator_factory.cc

Issue 1985923002: Wireframe scheduler implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per DougArnett 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" 5 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h" 10 #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h"
(...skipping 24 matching lines...) Expand all
35 content::BrowserContext* context) { 35 content::BrowserContext* context) {
36 return static_cast<RequestCoordinator*>( 36 return static_cast<RequestCoordinator*>(
37 GetInstance()->GetServiceForBrowserContext(context, true)); 37 GetInstance()->GetServiceForBrowserContext(context, true));
38 } 38 }
39 39
40 KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor( 40 KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor(
41 content::BrowserContext* context) const { 41 content::BrowserContext* context) const {
42 std::unique_ptr<OfflinerPolicy> policy(new OfflinerPolicy()); 42 std::unique_ptr<OfflinerPolicy> policy(new OfflinerPolicy());
43 std::unique_ptr<OfflinerFactory> prerenderer_offliner( 43 std::unique_ptr<OfflinerFactory> prerenderer_offliner(
44 new PrerenderingOfflinerFactory(context)); 44 new PrerenderingOfflinerFactory(context));
45 // TODO(petewil) Add support for server based offliner when it is ready.
dewittj 2016/05/25 23:16:45 I still prefer removing this comment.
Pete Williamson 2016/05/25 23:59:58 Done.
45 std::unique_ptr<RequestQueueInMemoryStore> store( 46 std::unique_ptr<RequestQueueInMemoryStore> store(
46 new RequestQueueInMemoryStore()); 47 new RequestQueueInMemoryStore());
47 std::unique_ptr<RequestQueue> queue(new RequestQueue(std::move(store))); 48 std::unique_ptr<RequestQueue> queue(new RequestQueue(std::move(store)));
48 // TODO(petewil) Add support for server based offliner when it is ready.
49
50 std::unique_ptr<Scheduler> 49 std::unique_ptr<Scheduler>
51 scheduler(new android::BackgroundSchedulerBridge()); 50 scheduler(new android::BackgroundSchedulerBridge());
52 // TODO(petewil) Add support for server based offliner when it is ready.
53 51
54 return new RequestCoordinator(std::move(policy), 52 return new RequestCoordinator(std::move(policy),
55 std::move(prerenderer_offliner), 53 std::move(prerenderer_offliner),
56 std::move(queue), 54 std::move(queue),
57 std::move(scheduler)); 55 std::move(scheduler));
58 } 56 }
59 57
60 content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse( 58 content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse(
61 content::BrowserContext* context) const { 59 content::BrowserContext* context) const {
62 // TODO(petewil): Make sure we support incognito properly. 60 // TODO(petewil): Make sure we support incognito properly.
63 return context; 61 return context;
64 } 62 }
65 63
66 } // namespace offline_pages 64 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698