Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1201)

Unified Diff: services/service_cache/service_cache_app.cc

Issue 1088533003: Adding URLResponse Disk Cache to mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: And now with full app tests and a bug fix. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698