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

Side by Side Diff: components/cronet/ios/test/quic_test_server.cc

Issue 2102253003: Make SpdyHeaderBlock non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS fix. Created 4 years, 5 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 | net/http/bidirectional_stream_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/cronet/ios/test/quic_test_server.h" 5 #include "components/cronet/ios/test/quic_test_server.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
10 #include "base/path_service.h" 12 #include "base/path_service.h"
11 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
12 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
13 #include "net/base/ip_address.h" 15 #include "net/base/ip_address.h"
14 #include "net/base/ip_endpoint.h" 16 #include "net/base/ip_endpoint.h"
15 #include "net/quic/crypto/proof_source_chromium.h" 17 #include "net/quic/crypto/proof_source_chromium.h"
16 #include "net/spdy/spdy_header_block.h" 18 #include "net/spdy/spdy_header_block.h"
(...skipping 29 matching lines...) Expand all
46 static bool setup_done = false; 48 static bool setup_done = false;
47 if (setup_done) 49 if (setup_done)
48 return; 50 return;
49 setup_done = true; 51 setup_done = true;
50 net::SpdyHeaderBlock headers; 52 net::SpdyHeaderBlock headers;
51 headers.ReplaceOrAppendHeader(kHelloHeaderName, kHelloHeaderValue); 53 headers.ReplaceOrAppendHeader(kHelloHeaderName, kHelloHeaderValue);
52 headers.ReplaceOrAppendHeader(kStatusHeader, kHelloStatus); 54 headers.ReplaceOrAppendHeader(kStatusHeader, kHelloStatus);
53 net::SpdyHeaderBlock trailers; 55 net::SpdyHeaderBlock trailers;
54 trailers.ReplaceOrAppendHeader(kHelloTrailerName, kHelloTrailerValue); 56 trailers.ReplaceOrAppendHeader(kHelloTrailerName, kHelloTrailerValue);
55 net::QuicInMemoryCache::GetInstance()->AddResponse( 57 net::QuicInMemoryCache::GetInstance()->AddResponse(
56 kTestServerHost, kHelloPath, headers, kHelloBodyValue, trailers); 58 kTestServerHost, kHelloPath, std::move(headers), kHelloBodyValue,
59 std::move(trailers));
57 } 60 }
58 61
59 void StartQuicServerOnServerThread(const base::FilePath& test_files_root, 62 void StartQuicServerOnServerThread(const base::FilePath& test_files_root,
60 base::WaitableEvent* server_started_event) { 63 base::WaitableEvent* server_started_event) {
61 DCHECK(g_quic_server_thread->task_runner()->BelongsToCurrentThread()); 64 DCHECK(g_quic_server_thread->task_runner()->BelongsToCurrentThread());
62 DCHECK(!g_quic_server); 65 DCHECK(!g_quic_server);
63 66
64 // Set up in-memory cache. 67 // Set up in-memory cache.
65 SetupQuicInMemoryCache(); 68 SetupQuicInMemoryCache();
66 net::QuicConfig config; 69 net::QuicConfig config;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 base::WaitableEvent::ResetPolicy::MANUAL, 125 base::WaitableEvent::ResetPolicy::MANUAL,
123 base::WaitableEvent::InitialState::NOT_SIGNALED); 126 base::WaitableEvent::InitialState::NOT_SIGNALED);
124 g_quic_server_thread->task_runner()->PostTask( 127 g_quic_server_thread->task_runner()->PostTask(
125 FROM_HERE, base::Bind(&ShutdownOnServerThread, &server_stopped_event)); 128 FROM_HERE, base::Bind(&ShutdownOnServerThread, &server_stopped_event));
126 server_stopped_event.Wait(); 129 server_stopped_event.Wait();
127 delete g_quic_server_thread; 130 delete g_quic_server_thread;
128 g_quic_server_thread = nullptr; 131 g_quic_server_thread = nullptr;
129 } 132 }
130 133
131 } // namespace cronet 134 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698