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

Unified Diff: net/quic/quic_in_memory_cache.cc

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address further comments Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_in_memory_cache.cc
diff --git a/net/quic/quic_in_memory_cache.cc b/net/quic/quic_in_memory_cache.cc
index 45d25b24e407759bd39de8a4fe923d6a2f759d43..628fe9a5fa8a9d0d8ee0d11e83ff642710317ace 100644
--- a/net/quic/quic_in_memory_cache.cc
+++ b/net/quic/quic_in_memory_cache.cc
@@ -4,7 +4,6 @@
#include "net/quic/quic_in_memory_cache.h"
-#include "base/file_util.h"
#include "base/files/file_enumerator.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
@@ -20,9 +19,9 @@ using std::string;
namespace net {
-namespace {
+FilePath::StringType g_quic_in_memory_cache_dir = FILE_PATH_LITERAL("");
-const FilePath::CharType* g_quic_in_memory_cache_dir = FILE_PATH_LITERAL("");
+namespace {
// BalsaVisitor implementation (glue) which caches response bodies.
class CachingBalsaVisitor : public NoOpBalsaVisitor {
@@ -132,7 +131,7 @@ void QuicInMemoryCache::ResetForTests() {
void QuicInMemoryCache::Initialize() {
// If there's no defined cache dir, we have no initialization to do.
- if (g_quic_in_memory_cache_dir[0] == '\0') {
+ if (g_quic_in_memory_cache_dir.size() == 0) {
VLOG(1) << "No cache directory found. Skipping initialization.";
return;
}
@@ -185,7 +184,8 @@ void QuicInMemoryCache::Initialize() {
processed += file_contents.length();
}
- StringPiece base = file.AsUTF8Unsafe();
+ string utf8_file = file.AsUTF8Unsafe();
+ StringPiece base = utf8_file;
if (response_headers.HasHeader("X-Original-Url")) {
base = response_headers.GetHeader("X-Original-Url");
response_headers.RemoveAllOfHeader("X-Original-Url");

Powered by Google App Engine
This is Rietveld 408576698