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

Side by Side Diff: net/tools/quic/quic_in_memory_cache.cc

Issue 678073004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/quic/quic_in_memory_cache.h" 5 #include "net/tools/quic/quic_in_memory_cache.h"
6 6
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 11 matching lines...) Expand all
22 namespace tools { 22 namespace tools {
23 23
24 std::string FLAGS_quic_in_memory_cache_dir = ""; 24 std::string FLAGS_quic_in_memory_cache_dir = "";
25 25
26 namespace { 26 namespace {
27 27
28 // BalsaVisitor implementation (glue) which caches response bodies. 28 // BalsaVisitor implementation (glue) which caches response bodies.
29 class CachingBalsaVisitor : public NoOpBalsaVisitor { 29 class CachingBalsaVisitor : public NoOpBalsaVisitor {
30 public: 30 public:
31 CachingBalsaVisitor() : done_framing_(false) {} 31 CachingBalsaVisitor() : done_framing_(false) {}
32 virtual void ProcessBodyData(const char* input, size_t size) override { 32 void ProcessBodyData(const char* input, size_t size) override {
33 AppendToBody(input, size); 33 AppendToBody(input, size);
34 } 34 }
35 virtual void MessageDone() override { 35 void MessageDone() override { done_framing_ = true; }
36 done_framing_ = true; 36 void HandleHeaderError(BalsaFrame* framer) override { UnhandledError(); }
37 } 37 void HandleHeaderWarning(BalsaFrame* framer) override { UnhandledError(); }
38 virtual void HandleHeaderError(BalsaFrame* framer) override { 38 void HandleChunkingError(BalsaFrame* framer) override { UnhandledError(); }
39 UnhandledError(); 39 void HandleBodyError(BalsaFrame* framer) override { UnhandledError(); }
40 }
41 virtual void HandleHeaderWarning(BalsaFrame* framer) override {
42 UnhandledError();
43 }
44 virtual void HandleChunkingError(BalsaFrame* framer) override {
45 UnhandledError();
46 }
47 virtual void HandleBodyError(BalsaFrame* framer) override {
48 UnhandledError();
49 }
50 void UnhandledError() { 40 void UnhandledError() {
51 LOG(DFATAL) << "Unhandled error framing HTTP."; 41 LOG(DFATAL) << "Unhandled error framing HTTP.";
52 } 42 }
53 void AppendToBody(const char* input, size_t size) { 43 void AppendToBody(const char* input, size_t size) {
54 body_.append(input, size); 44 body_.append(input, size);
55 } 45 }
56 bool done_framing() const { return done_framing_; } 46 bool done_framing() const { return done_framing_; }
57 const string& body() const { return body_; } 47 const string& body() const { return body_; }
58 48
59 private: 49 private:
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } else if (StringPieceUtils::StartsWithIgnoreCase(uri, "https://")) { 223 } else if (StringPieceUtils::StartsWithIgnoreCase(uri, "https://")) {
234 uri.remove_prefix(8); 224 uri.remove_prefix(8);
235 } else if (StringPieceUtils::StartsWithIgnoreCase(uri, "http://")) { 225 } else if (StringPieceUtils::StartsWithIgnoreCase(uri, "http://")) {
236 uri.remove_prefix(7); 226 uri.remove_prefix(7);
237 } 227 }
238 return host.as_string() + uri.as_string(); 228 return host.as_string() + uri.as_string();
239 } 229 }
240 230
241 } // namespace tools 231 } // namespace tools
242 } // namespace net 232 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_epoll_connection_helper_test.cc ('k') | net/tools/quic/quic_in_memory_cache_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698