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

Side by Side Diff: chrome/test/chromedriver/server/chromedriver_server.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 | « chrome/test/base/web_ui_browser_test.cc ('k') | chrome/test/chromedriver/session.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <locale> 9 #include <locale>
10 #include <memory> 10 #include <memory>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 const HttpRequestHandlerFunc& handle_request_on_cmd_func, 164 const HttpRequestHandlerFunc& handle_request_on_cmd_func,
165 const net::HttpServerRequestInfo& request, 165 const net::HttpServerRequestInfo& request,
166 const HttpResponseSenderFunc& send_response_func) { 166 const HttpResponseSenderFunc& send_response_func) {
167 cmd_task_runner->PostTask( 167 cmd_task_runner->PostTask(
168 FROM_HERE, base::Bind(handle_request_on_cmd_func, request, 168 FROM_HERE, base::Bind(handle_request_on_cmd_func, request,
169 base::Bind(&SendResponseOnCmdThread, 169 base::Bind(&SendResponseOnCmdThread,
170 base::ThreadTaskRunnerHandle::Get(), 170 base::ThreadTaskRunnerHandle::Get(),
171 send_response_func))); 171 send_response_func)));
172 } 172 }
173 173
174 base::LazyInstance<base::ThreadLocalPointer<HttpServer> > 174 base::LazyInstance<base::ThreadLocalPointer<HttpServer>>::DestructorAtExit
175 lazy_tls_server = LAZY_INSTANCE_INITIALIZER; 175 lazy_tls_server = LAZY_INSTANCE_INITIALIZER;
176 176
177 void StopServerOnIOThread() { 177 void StopServerOnIOThread() {
178 // Note, |server| may be NULL. 178 // Note, |server| may be NULL.
179 HttpServer* server = lazy_tls_server.Pointer()->Get(); 179 HttpServer* server = lazy_tls_server.Pointer()->Get();
180 lazy_tls_server.Pointer()->Set(NULL); 180 lazy_tls_server.Pointer()->Set(NULL);
181 delete server; 181 delete server;
182 } 182 }
183 183
184 void StartServerOnIOThread(uint16_t port, 184 void StartServerOnIOThread(uint16_t port,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 333
334 if (!InitLogging()) { 334 if (!InitLogging()) {
335 printf("Unable to initialize logging. Exiting...\n"); 335 printf("Unable to initialize logging. Exiting...\n");
336 return 1; 336 return 1;
337 } 337 }
338 RunServer(port, allow_remote, whitelisted_ips, url_base, adb_port, 338 RunServer(port, allow_remote, whitelisted_ips, url_base, adb_port,
339 std::move(port_server)); 339 std::move(port_server));
340 return 0; 340 return 0;
341 } 341 }
OLDNEW
« no previous file with comments | « chrome/test/base/web_ui_browser_test.cc ('k') | chrome/test/chromedriver/session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698