// Copyright (c) 2012 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.

#ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once

#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "chrome/common/nacl_types.h"
#include "ipc/ipc_channel.h"

// The BrokerThread class represents the thread that handles the messages from
// the browser process and starts NaCl loader processes.
class NaClBrokerListener : public IPC::Channel::Listener {
 public:
  NaClBrokerListener();
  ~NaClBrokerListener();

  void Listen();

  // IPC::Channel::Listener implementation.
  virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
  virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
  virtual void OnChannelError() OVERRIDE;

 private:
  void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
  void OnStopBroker();

  base::ProcessHandle browser_handle_;
  scoped_ptr<IPC::Channel> channel_;

  DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};

#endif  // CHROME_NACL_NACL_BROKER_LISTENER_H_

// Copyright (c) 2011 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.

#ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once

#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "chrome/common/nacl_types.h"
#include "ipc/ipc_channel.h"

// The BrokerThread class represents the thread that handles the messages from
// the browser process and starts NaCl loader processes.
class NaClBrokerListener : public IPC::Channel::Listener {
 public:
  NaClBrokerListener();
  ~NaClBrokerListener();

  void Listen();

  // IPC::Channel::Listener implementation.
  virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
  virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
  virtual void OnChannelError() OVERRIDE;

 private:
  void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
  void OnShareBrowserHandle(int browser_handle);
  void OnStopBroker();

  base::ProcessHandle browser_handle_;
  scoped_ptr<IPC::Channel> channel_;

  DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};

#endif  // CHROME_NACL_NACL_BROKER_LISTENER_H_

--- 
+++ 
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
 
@@ -27,7 +27,6 @@
 
  private:
   void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
-  void OnShareBrowserHandle(int browser_handle);
   void OnStopBroker();
 
   base::ProcessHandle browser_handle_;
NaCl: Remove declaration of non-existent method

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/9592039

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@125431 0039d316-1c4b-4281-b951-d872f2087c98
