Index: chrome/browser/browser_io_message_filter.cc |
=================================================================== |
--- chrome/browser/browser_io_message_filter.cc (revision 0) |
+++ chrome/browser/browser_io_message_filter.cc (revision 0) |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/browser_io_message_filter.h" |
+ |
+#include "base/logging.h" |
+#include "base/process_util.h" |
+ |
+BrowserIOMessageFilter::BrowserIOMessageFilter() : channel_(NULL) { |
+} |
+ |
+BrowserIOMessageFilter::~BrowserIOMessageFilter() { |
+} |
+ |
+void BrowserIOMessageFilter::OnFilterAdded(IPC::Channel* channel) { |
+ channel_ = channel; |
+} |
+ |
+void BrowserIOMessageFilter::OnChannelClosing() { |
+ channel_ = NULL; |
+} |
+ |
+void BrowserIOMessageFilter::OnChannelConnected(int32 peer_pid) { |
+ if (!base::OpenProcessHandle(peer_pid, &peer_handle_)) { |
+ NOTREACHED(); |
+ } |
+} |
+ |
+bool BrowserIOMessageFilter::Send(IPC::Message* msg) { |
+ if (channel_) |
+ return channel_->Send(msg); |
+ |
+ delete msg; |
+ return false; |
+} |
Property changes on: chrome\browser\browser_io_message_filter.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |