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

Unified Diff: services/url_response_disk_cache/url_response_disk_cache_app.cc

Issue 1088533003: Adding URLResponse Disk Cache to mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 7 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/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

Powered by Google App Engine
This is Rietveld 408576698