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

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

Issue 612323013: QUIC - (no behavior change) s/NULL/nullptr/g in .../quic/... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/tools/quic/quic_server.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 response_headers.SetRequestFirstlineFromStringPieces(version, 57 response_headers.SetRequestFirstlineFromStringPieces(version,
58 response_code, 58 response_code,
59 response_detail); 59 response_detail);
60 response_headers.AppendHeader("content-length", 60 response_headers.AppendHeader("content-length",
61 base::IntToString(body.length())); 61 base::IntToString(body.length()));
62 62
63 // Check if response already exists and matches. 63 // Check if response already exists and matches.
64 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance(); 64 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance();
65 const QuicInMemoryCache::Response* cached_response = 65 const QuicInMemoryCache::Response* cached_response =
66 cache->GetResponse(request_headers); 66 cache->GetResponse(request_headers);
67 if (cached_response != NULL) { 67 if (cached_response != nullptr) {
68 std::string cached_response_headers_str, response_headers_str; 68 std::string cached_response_headers_str, response_headers_str;
69 cached_response->headers().DumpToString(&cached_response_headers_str); 69 cached_response->headers().DumpToString(&cached_response_headers_str);
70 response_headers.DumpToString(&response_headers_str); 70 response_headers.DumpToString(&response_headers_str);
71 CHECK_EQ(cached_response_headers_str, response_headers_str); 71 CHECK_EQ(cached_response_headers_str, response_headers_str);
72 CHECK_EQ(cached_response->body(), body); 72 CHECK_EQ(cached_response->body(), body);
73 return; 73 return;
74 } 74 }
75 cache->AddResponse(request_headers, response_headers, body); 75 cache->AddResponse(request_headers, response_headers, body);
76 } 76 }
77 }; 77 };
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 CreateRequest("www.google.com", "/index.html", &request_headers); 129 CreateRequest("www.google.com", "/index.html", &request_headers);
130 130
131 const QuicInMemoryCache::Response* response = 131 const QuicInMemoryCache::Response* response =
132 QuicInMemoryCache::GetInstance()->GetResponse(request_headers); 132 QuicInMemoryCache::GetInstance()->GetResponse(request_headers);
133 ASSERT_FALSE(response); 133 ASSERT_FALSE(response);
134 } 134 }
135 135
136 } // namespace test 136 } // namespace test
137 } // namespace tools 137 } // namespace tools
138 } // namespace net 138 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/tools/quic/quic_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698