OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/common/ipc_channel_win.h" | 5 #include "chrome/common/ipc_channel_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 pipe_ = INVALID_HANDLE_VALUE; | 64 pipe_ = INVALID_HANDLE_VALUE; |
65 } | 65 } |
66 | 66 |
67 // Make sure all IO has completed. | 67 // Make sure all IO has completed. |
68 base::Time start = base::Time::Now(); | 68 base::Time start = base::Time::Now(); |
69 while (input_state_.is_pending || output_state_.is_pending) { | 69 while (input_state_.is_pending || output_state_.is_pending) { |
70 MessageLoopForIO::current()->WaitForIOCompletion(INFINITE, this); | 70 MessageLoopForIO::current()->WaitForIOCompletion(INFINITE, this); |
71 } | 71 } |
72 if (waited) { | 72 if (waited) { |
73 // We want to see if we block the message loop for too long. | 73 // We want to see if we block the message loop for too long. |
74 UMA_HISTOGRAM_TIMES(L"AsyncIO.IPCChannelClose", base::Time::Now() - start); | 74 UMA_HISTOGRAM_TIMES("AsyncIO.IPCChannelClose", base::Time::Now() - start); |
75 } | 75 } |
76 | 76 |
77 while (!output_queue_.empty()) { | 77 while (!output_queue_.empty()) { |
78 Message* m = output_queue_.front(); | 78 Message* m = output_queue_.front(); |
79 output_queue_.pop(); | 79 output_queue_.pop(); |
80 delete m; | 80 delete m; |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 bool Channel::ChannelImpl::Send(Message* message) { | 84 bool Channel::ChannelImpl::Send(Message* message) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 void Channel::set_listener(Listener* listener) { | 432 void Channel::set_listener(Listener* listener) { |
433 channel_impl_->set_listener(listener); | 433 channel_impl_->set_listener(listener); |
434 } | 434 } |
435 | 435 |
436 bool Channel::Send(Message* message) { | 436 bool Channel::Send(Message* message) { |
437 return channel_impl_->Send(message); | 437 return channel_impl_->Send(message); |
438 } | 438 } |
439 | 439 |
440 } // namespace IPC | 440 } // namespace IPC |
OLD | NEW |