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

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

Issue 2510463002: [Cronet] Retain block passed to setRequestFilterBlock on iOS. (Closed)
Patch Set: Address comment. Created 4 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
« no previous file with comments | « components/cronet/ios/test/cronet_http_test.mm ('k') | no next file » | 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/test_server.h" 5 #include "components/cronet/ios/test/test_server.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 } // namespace 39 } // namespace
40 40
41 namespace cronet { 41 namespace cronet {
42 42
43 /* static */ 43 /* static */
44 bool TestServer::Start() { 44 bool TestServer::Start() {
45 DCHECK(!g_test_server.get()); 45 DCHECK(!g_test_server.get());
46 g_test_server = base::MakeUnique<net::EmbeddedTestServer>( 46 g_test_server = base::MakeUnique<net::EmbeddedTestServer>(
47 net::EmbeddedTestServer::TYPE_HTTPS); 47 net::EmbeddedTestServer::TYPE_HTTP);
48 g_test_server->RegisterRequestHandler(base::Bind(&EchoHeaderInRequest)); 48 g_test_server->RegisterRequestHandler(base::Bind(&EchoHeaderInRequest));
49 CHECK(g_test_server->Start()); 49 CHECK(g_test_server->Start());
50 return true; 50 return true;
51 } 51 }
52 52
53 void TestServer::Shutdown() { 53 void TestServer::Shutdown() {
54 DCHECK(g_test_server.get()); 54 DCHECK(g_test_server.get());
55 g_test_server.reset(); 55 g_test_server.reset();
56 } 56 }
57 57
58 std::string TestServer::GetEchoHeaderURL(const std::string& header_name) { 58 std::string TestServer::GetEchoHeaderURL(const std::string& header_name) {
59 DCHECK(g_test_server); 59 DCHECK(g_test_server);
60 return g_test_server->GetURL(kEchoHeaderPath + header_name).spec(); 60 return g_test_server->GetURL(kEchoHeaderPath + header_name).spec();
61 } 61 }
62 62
63 } // namespace cronet 63 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/ios/test/cronet_http_test.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698