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

Side by Side Diff: services/url_response_disk_cache/url_response_disk_cache_app.cc

Issue 1276073004: Offline By Default (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add missing explicits. Created 5 years, 3 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/url_response_disk_cache/url_response_disk_cache_app.h" 5 #include "services/url_response_disk_cache/url_response_disk_cache_app.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "services/url_response_disk_cache/url_response_disk_cache_impl.h" 8 #include "services/url_response_disk_cache/url_response_disk_cache_impl.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 URLResponseDiskCacheApp::URLResponseDiskCacheApp(base::TaskRunner* task_runner) 12 URLResponseDiskCacheApp::URLResponseDiskCacheApp(
13 : task_runner_(task_runner) { 13 scoped_refptr<base::TaskRunner> task_runner)
14 } 14 : task_runner_(task_runner) {}
15 15
16 URLResponseDiskCacheApp::~URLResponseDiskCacheApp() { 16 URLResponseDiskCacheApp::~URLResponseDiskCacheApp() {
17 } 17 }
18 18
19 void URLResponseDiskCacheApp::Initialize(ApplicationImpl* app) { 19 void URLResponseDiskCacheApp::Initialize(ApplicationImpl* app) {
20 base::CommandLine command_line(app->args()); 20 base::CommandLine command_line(app->args());
21 if (command_line.HasSwitch("clear")) { 21 bool force_clean = command_line.HasSwitch("clear");
22 URLResponseDiskCacheImpl::ClearCache(task_runner_); 22 db_ = URLResponseDiskCacheImpl::CreateDB(task_runner_, force_clean);
23 }
24 } 23 }
25 24
26 bool URLResponseDiskCacheApp::ConfigureIncomingConnection( 25 bool URLResponseDiskCacheApp::ConfigureIncomingConnection(
27 ApplicationConnection* connection) { 26 ApplicationConnection* connection) {
28 connection->AddService<URLResponseDiskCache>(this); 27 connection->AddService<URLResponseDiskCache>(this);
29 return true; 28 return true;
30 } 29 }
31 30
32 void URLResponseDiskCacheApp::Create( 31 void URLResponseDiskCacheApp::Create(
33 ApplicationConnection* connection, 32 ApplicationConnection* connection,
34 InterfaceRequest<URLResponseDiskCache> request) { 33 InterfaceRequest<URLResponseDiskCache> request) {
35 new URLResponseDiskCacheImpl( 34 new URLResponseDiskCacheImpl(
36 task_runner_, connection->GetRemoteApplicationURL(), request.Pass()); 35 task_runner_, db_, connection->GetRemoteApplicationURL(), request.Pass());
37 } 36 }
38 37
39 } // namespace mojo 38 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698