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

Side by Side Diff: net/ssl/channel_id_service.cc

Issue 2854243003: Use constexpr TaskTraits constructor in net. (Closed)
Patch Set: Created 3 years, 7 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/socket/tcp_socket_posix.cc ('k') | net/url_request/url_fetcher_impl_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/ssl/channel_id_service.h" 5 #include "net/ssl/channel_id_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Starts the worker asynchronously. 113 // Starts the worker asynchronously.
114 void Start(const scoped_refptr<base::TaskRunner>& task_runner) { 114 void Start(const scoped_refptr<base::TaskRunner>& task_runner) {
115 DCHECK(origin_task_runner_->RunsTasksOnCurrentThread()); 115 DCHECK(origin_task_runner_->RunsTasksOnCurrentThread());
116 116
117 auto callback = base::Bind(&ChannelIDServiceWorker::Run, base::Owned(this)); 117 auto callback = base::Bind(&ChannelIDServiceWorker::Run, base::Owned(this));
118 118
119 if (task_runner) { 119 if (task_runner) {
120 task_runner->PostTask(FROM_HERE, callback); 120 task_runner->PostTask(FROM_HERE, callback);
121 } else { 121 } else {
122 base::PostTaskWithTraits( 122 base::PostTaskWithTraits(
123 FROM_HERE, base::TaskTraits() 123 FROM_HERE,
124 .WithShutdownBehavior( 124 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
125 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
126 .MayBlock(),
127 callback); 125 callback);
128 } 126 }
129 } 127 }
130 128
131 private: 129 private:
132 void Run() { 130 void Run() {
133 // Runs on a worker thread. 131 // Runs on a worker thread.
134 int error = ERR_FAILED; 132 int error = ERR_FAILED;
135 std::unique_ptr<ChannelIDStore::ChannelID> channel_id = 133 std::unique_ptr<ChannelIDStore::ChannelID> channel_id =
136 GenerateChannelID(server_identifier_, &error); 134 GenerateChannelID(server_identifier_, &error);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } 475 }
478 476
479 return err; 477 return err;
480 } 478 }
481 479
482 int ChannelIDService::channel_id_count() { 480 int ChannelIDService::channel_id_count() {
483 return channel_id_store_->GetChannelIDCount(); 481 return channel_id_store_->GetChannelIDCount();
484 } 482 }
485 483
486 } // namespace net 484 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_socket_posix.cc ('k') | net/url_request/url_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698