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_process_host.h" | 5 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 launcher_(std::move(launcher)), | 51 launcher_(std::move(launcher)), |
52 closed_(false), | 52 closed_(false), |
53 #if defined(OS_POSIX) | 53 #if defined(OS_POSIX) |
54 read_file_(-1), | 54 read_file_(-1), |
55 #endif | 55 #endif |
56 read_pending_(false), | 56 read_pending_(false), |
57 write_pending_(false), | 57 write_pending_(false), |
58 weak_factory_(this) { | 58 weak_factory_(this) { |
59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
60 | 60 |
61 task_runner_ = content::BrowserThread::GetMessageLoopProxyForThread( | 61 task_runner_ = content::BrowserThread::GetTaskRunnerForThread( |
62 content::BrowserThread::IO); | 62 content::BrowserThread::IO); |
63 } | 63 } |
64 | 64 |
65 NativeMessageProcessHost::~NativeMessageProcessHost() { | 65 NativeMessageProcessHost::~NativeMessageProcessHost() { |
66 DCHECK(task_runner_->BelongsToCurrentThread()); | 66 DCHECK(task_runner_->BelongsToCurrentThread()); |
67 | 67 |
68 if (process_.IsValid()) { | 68 if (process_.IsValid()) { |
69 // Kill the host process if necessary to make sure we don't leave zombies. | 69 // Kill the host process if necessary to make sure we don't leave zombies. |
70 // On OSX base::EnsureProcessTerminated() may block, so we have to post a | 70 // On OSX base::EnsureProcessTerminated() may block, so we have to post a |
71 // task on the blocking pool. | 71 // task on the blocking pool. |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 if (!closed_) { | 359 if (!closed_) { |
360 closed_ = true; | 360 closed_ = true; |
361 read_stream_.reset(); | 361 read_stream_.reset(); |
362 write_stream_.reset(); | 362 write_stream_.reset(); |
363 client_->CloseChannel(error_message); | 363 client_->CloseChannel(error_message); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 } // namespace extensions | 367 } // namespace extensions |
OLD | NEW |