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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698