OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 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 "services/service_cache/service_cache_app.h" |
| 6 |
| 7 #include "services/service_cache/service_cache_impl.h" |
| 8 |
| 9 namespace mojo { |
| 10 namespace service_cache { |
| 11 |
| 12 namespace { |
| 13 |
| 14 const size_t kMaxBlockingPoolThreads = 3; |
| 15 |
| 16 } // namespace |
| 17 |
| 18 ServiceCacheApp::ServiceCacheApp() { |
| 19 } |
| 20 |
| 21 ServiceCacheApp::~ServiceCacheApp() { |
| 22 if (worker_pool_) |
| 23 worker_pool_->Shutdown(); |
| 24 } |
| 25 |
| 26 bool ServiceCacheApp::ConfigureIncomingConnection( |
| 27 ApplicationConnection* connection) { |
| 28 connection->AddService<ServiceCache>(this); |
| 29 return true; |
| 30 } |
| 31 |
| 32 void ServiceCacheApp::Create(ApplicationConnection* connection, |
| 33 InterfaceRequest<ServiceCache> request) { |
| 34 if (!worker_pool_) { |
| 35 worker_pool_ = new base::SequencedWorkerPool(kMaxBlockingPoolThreads, |
| 36 "ServiceCachePool"); |
| 37 } |
| 38 new ServiceCacheImpl(worker_pool_, connection->GetRemoteApplicationURL(), |
| 39 request.Pass()); |
| 40 } |
| 41 |
| 42 } // namespace service_cache |
| 43 } // namespace mojo |
OLD | NEW |