OLD | NEW |
---|---|
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 Loading... | |
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/24 16:56:19
I don't think this comment is really necessary her
Pete Williamson
2016/05/24 18:49:32
As I recall, I was asked to add it in a previous c
| |
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 // Create the Bridge from the C++ side (and it will initialize from the Java |
dewittj
2016/05/24 16:56:19
I think this is out of date now.
Pete Williamson
2016/05/24 18:49:32
Done.
| |
49 | 50 // side). |
50 std::unique_ptr<Scheduler> | 51 std::unique_ptr<Scheduler> |
51 scheduler(new android::BackgroundSchedulerBridge()); | 52 scheduler(new android::BackgroundSchedulerBridge()); |
52 // TODO(petewil) Add support for server based offliner when it is ready. | |
53 | 53 |
54 return new RequestCoordinator(std::move(policy), | 54 return new RequestCoordinator(std::move(policy), |
55 std::move(prerenderer_offliner), | 55 std::move(prerenderer_offliner), |
56 std::move(queue), | 56 std::move(queue), |
57 std::move(scheduler)); | 57 std::move(scheduler)); |
58 } | 58 } |
59 | 59 |
60 content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse( | 60 content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse( |
61 content::BrowserContext* context) const { | 61 content::BrowserContext* context) const { |
62 // TODO(petewil): Make sure we support incognito properly. | 62 // TODO(petewil): Make sure we support incognito properly. |
63 return context; | 63 return context; |
64 } | 64 } |
65 | 65 |
66 } // namespace offline_pages | 66 } // namespace offline_pages |
OLD | NEW |