OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "net/tools/flip_server/mem_cache.h" | 5 #include "net/tools/flip_server/mem_cache.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "net/tools/flip_server/url_to_filename_encoder.h" | 22 #include "net/tools/flip_server/url_to_filename_encoder.h" |
23 #include "net/tools/flip_server/url_utilities.h" | 23 #include "net/tools/flip_server/url_utilities.h" |
24 | 24 |
25 namespace { | 25 namespace { |
26 // The directory where cache locates); | 26 // The directory where cache locates); |
27 const char FLAGS_cache_base_dir[] = "."; | 27 const char FLAGS_cache_base_dir[] = "."; |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 namespace net { | 30 namespace net { |
31 | 31 |
| 32 StoreBodyAndHeadersVisitor::StoreBodyAndHeadersVisitor() = default; |
| 33 |
32 void StoreBodyAndHeadersVisitor::ProcessBodyData(const char* input, | 34 void StoreBodyAndHeadersVisitor::ProcessBodyData(const char* input, |
33 size_t size) { | 35 size_t size) { |
34 body.append(input, size); | 36 body.append(input, size); |
35 } | 37 } |
36 | 38 |
37 void StoreBodyAndHeadersVisitor::HandleHeaderError(BalsaFrame* framer) { | 39 void StoreBodyAndHeadersVisitor::HandleHeaderError(BalsaFrame* framer) { |
38 HandleError(); | 40 HandleError(); |
39 } | 41 } |
40 | 42 |
41 void StoreBodyAndHeadersVisitor::HandleHeaderWarning(BalsaFrame* framer) { | 43 void StoreBodyAndHeadersVisitor::HandleHeaderWarning(BalsaFrame* framer) { |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 245 } |
244 | 246 |
245 void MemoryCache::ClearFiles() { | 247 void MemoryCache::ClearFiles() { |
246 for (Files::const_iterator i = files_.begin(); i != files_.end(); ++i) { | 248 for (Files::const_iterator i = files_.begin(); i != files_.end(); ++i) { |
247 delete i->second; | 249 delete i->second; |
248 } | 250 } |
249 files_.clear(); | 251 files_.clear(); |
250 } | 252 } |
251 | 253 |
252 } // namespace net | 254 } // namespace net |
OLD | NEW |