Index: services/url_response_disk_cache/url_response_disk_cache_app.cc |
diff --git a/services/url_response_disk_cache/url_response_disk_cache_app.cc b/services/url_response_disk_cache/url_response_disk_cache_app.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5219b2d4d1305c4ff78ec534da5703443e6e64f3 |
--- /dev/null |
+++ b/services/url_response_disk_cache/url_response_disk_cache_app.cc |
@@ -0,0 +1,42 @@ |
+// 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/url_response_disk_cache/url_response_disk_cache_app.h" |
+ |
+#include "services/url_response_disk_cache/url_response_disk_cache_impl.h" |
+ |
+namespace mojo { |
+ |
+namespace { |
+ |
+const size_t kMaxBlockingPoolThreads = 3; |
+ |
+} // namespace |
+ |
+URLResponseDiskCacheApp::URLResponseDiskCacheApp() { |
+} |
+ |
+URLResponseDiskCacheApp::~URLResponseDiskCacheApp() { |
+ if (worker_pool_) |
+ worker_pool_->Shutdown(); |
+} |
+ |
+bool URLResponseDiskCacheApp::ConfigureIncomingConnection( |
+ ApplicationConnection* connection) { |
+ connection->AddService<URLResponseDiskCache>(this); |
+ return true; |
+} |
+ |
+void URLResponseDiskCacheApp::Create( |
+ ApplicationConnection* connection, |
+ InterfaceRequest<URLResponseDiskCache> request) { |
+ if (!worker_pool_) { |
+ worker_pool_ = new base::SequencedWorkerPool(kMaxBlockingPoolThreads, |
+ "URLResponseDiskCachePool"); |
+ } |
+ new URLResponseDiskCacheImpl( |
+ worker_pool_, connection->GetRemoteApplicationURL(), request.Pass()); |
+} |
+ |
+} // namespace mojo |