Index: services/service_cache/service_cache_app.cc |
diff --git a/services/service_cache/service_cache_app.cc b/services/service_cache/service_cache_app.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b5ab8e9b271849f1f3b1b7ec0c1b7fdb169ee9d1 |
--- /dev/null |
+++ b/services/service_cache/service_cache_app.cc |
@@ -0,0 +1,43 @@ |
+// Copyright 2015 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. |
+ |
+#include "services/service_cache/service_cache_app.h" |
+ |
+#include "services/service_cache/service_cache_impl.h" |
+ |
+namespace mojo { |
+namespace service_cache { |
+ |
+namespace { |
+ |
+const size_t kMaxBlockingPoolThreads = 3; |
+ |
+} // namespace |
+ |
+ServiceCacheApp::ServiceCacheApp() { |
+} |
+ |
+ServiceCacheApp::~ServiceCacheApp() { |
+ if (worker_pool_) |
+ worker_pool_->Shutdown(); |
+} |
+ |
+bool ServiceCacheApp::ConfigureIncomingConnection( |
+ ApplicationConnection* connection) { |
+ connection->AddService<ServiceCache>(this); |
+ return true; |
+} |
+ |
+void ServiceCacheApp::Create(ApplicationConnection* connection, |
+ InterfaceRequest<ServiceCache> request) { |
+ if (!worker_pool_) { |
+ worker_pool_ = new base::SequencedWorkerPool(kMaxBlockingPoolThreads, |
+ "ServiceCachePool"); |
+ } |
+ new ServiceCacheImpl(worker_pool_, connection->GetRemoteApplicationURL(), |
+ request.Pass()); |
+} |
+ |
+} // namespace service_cache |
+} // namespace mojo |