Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
|
fgorski
2016/04/29 04:16:46
again this should be in c/b/a/op/
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/offline_pages/background/prerenderer_offliner_factory.h" | |
| 6 | |
| 7 #include "components/offline_pages/background/prerenderer_offliner.h" | |
| 8 | |
| 9 namespace offline_pages { | |
| 10 | |
| 11 class OfflinerPolicy; | |
| 12 | |
| 13 PrerendererOfflinerFactory::PrerendererOfflinerFactory() { | |
| 14 offliner_ = nullptr; | |
| 15 } | |
| 16 | |
| 17 PrerendererOfflinerFactory::~PrerendererOfflinerFactory() { | |
| 18 delete offliner_; | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 PrerendererOffliner* PrerendererOfflinerFactory::GetInstance( | |
| 23 OfflinerPolicy* policy) { | |
| 24 // TODO(petewil): Think about whether there might be any threading | |
| 25 // issues. This should always happen on the same thread, but make sure. | |
| 26 if (offliner_ == nullptr) { | |
| 27 offliner_ = new PrerendererOffliner(policy); | |
| 28 } | |
| 29 return offliner_; | |
| 30 } | |
| 31 | |
| 32 } // namespace offline_pages | |
| OLD | NEW |