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

Side by Side Diff: mojo/services/network/network_context.h

Issue 1344853002: Teach the network service to clear its disk cache if requested. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Address Ben's comments. 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
« no previous file with comments | « no previous file | mojo/services/network/network_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ 5 #ifndef MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_
6 #define MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ 6 #define MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/callback.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/task_runner.h"
12 15
13 namespace base { 16 namespace base {
14 class FilePath; 17 class FilePath;
15 } 18 }
16 19
17 namespace net { 20 namespace net {
18 class URLRequestContext; 21 class URLRequestContext;
19 } 22 }
20 23
21 namespace mojo { 24 namespace mojo {
22 class URLLoader; 25 class URLLoader;
23 class URLLoaderImpl; 26 class URLLoaderImpl;
24 27
25 class NetworkContext { 28 class NetworkContext {
26 public: 29 public:
30 // Cleares the cached content. The actual deletion will be performed using the
31 // given task runner, but cache appears as cleared immediately after the
32 // function returns.
33 static void ClearCache(const base::FilePath& base_path,
34 scoped_refptr<base::TaskRunner> task_runner,
35 const base::Closure& clear_finished_callback);
36
27 explicit NetworkContext( 37 explicit NetworkContext(
28 scoped_ptr<net::URLRequestContext> url_request_context); 38 scoped_ptr<net::URLRequestContext> url_request_context);
29 explicit NetworkContext(const base::FilePath& base_path); 39 explicit NetworkContext(const base::FilePath& base_path);
30 ~NetworkContext(); 40 ~NetworkContext();
31 41
32 net::URLRequestContext* url_request_context() { 42 net::URLRequestContext* url_request_context() {
33 return url_request_context_.get(); 43 return url_request_context_.get();
34 } 44 }
35 45
36 // These are called by individual url loaders as they are being created and 46 // These are called by individual url loaders as they are being created and
(...skipping 21 matching lines...) Expand all
58 // Set when entering the destructor, in order to avoid manipulations of the 68 // Set when entering the destructor, in order to avoid manipulations of the
59 // |url_loaders_| (as a url_loader might delete itself in Cleanup()). 69 // |url_loaders_| (as a url_loader might delete itself in Cleanup()).
60 bool in_shutdown_; 70 bool in_shutdown_;
61 71
62 DISALLOW_COPY_AND_ASSIGN(NetworkContext); 72 DISALLOW_COPY_AND_ASSIGN(NetworkContext);
63 }; 73 };
64 74
65 } // namespace mojo 75 } // namespace mojo
66 76
67 #endif // MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ 77 #endif // MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/services/network/network_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698