| OLD | NEW |
| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 WorkerDoneCallback; | 105 WorkerDoneCallback; |
| 106 | 106 |
| 107 ChannelIDServiceWorker(const std::string& server_identifier, | 107 ChannelIDServiceWorker(const std::string& server_identifier, |
| 108 const WorkerDoneCallback& callback) | 108 const WorkerDoneCallback& callback) |
| 109 : server_identifier_(server_identifier), | 109 : server_identifier_(server_identifier), |
| 110 origin_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 110 origin_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 111 callback_(callback) {} | 111 callback_(callback) {} |
| 112 | 112 |
| 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_->RunsTasksInCurrentSequence()); |
| 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, | 123 FROM_HERE, |
| 124 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, | 124 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 125 callback); | 125 callback); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 475 } |
| 476 | 476 |
| 477 return err; | 477 return err; |
| 478 } | 478 } |
| 479 | 479 |
| 480 int ChannelIDService::channel_id_count() { | 480 int ChannelIDService::channel_id_count() { |
| 481 return channel_id_store_->GetChannelIDCount(); | 481 return channel_id_store_->GetChannelIDCount(); |
| 482 } | 482 } |
| 483 | 483 |
| 484 } // namespace net | 484 } // namespace net |
| OLD | NEW |