| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/messaging/native_message_port.h" | 5 #include "chrome/browser/extensions/api/messaging/native_message_port.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" | 12 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 // Handles jumping between the |host_task_runner| and the | 17 // Handles jumping between the |host_task_runner| and the |
| 18 // |message_service_task_runner|. | 18 // |message_service_task_runner|. |
| 19 // All methods on the host interface should be called on |host_task_runner|. | 19 // All methods on the host interface should be called on |host_task_runner|. |
| 20 // All methods on |port| (that calls into MessageServices) should be called | 20 // All methods on |port| (that calls into MessageServices) should be called |
| 21 // on |message_service_task_runner|. | 21 // on |message_service_task_runner|. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 | 126 |
| 127 void NativeMessagePort::CloseChannel(const std::string& error_message) { | 127 void NativeMessagePort::CloseChannel(const std::string& error_message) { |
| 128 DCHECK(thread_checker_.CalledOnValidThread()); | 128 DCHECK(thread_checker_.CalledOnValidThread()); |
| 129 if (weak_message_service_) { | 129 if (weak_message_service_) { |
| 130 weak_message_service_->CloseChannel(port_id_, error_message); | 130 weak_message_service_->CloseChannel(port_id_, error_message); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace extensions | 134 } // namespace extensions |
| OLD | NEW |