summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/java_bridge_channel_host.h
blob: e00054789485263a167a0a77073c7a73ff202026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// 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 CONTENT_BROWSER_RENDERER_HOST_JAVA_BRIDGE_CHANNEL_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_JAVA_BRIDGE_CHANNEL_HOST_H_
#pragma once

#include "content/common/np_channel_base.h"

class JavaBridgeChannelHost : public NPChannelBase {
 public:
  static JavaBridgeChannelHost* GetJavaBridgeChannelHost(
      int renderer_id, base::MessageLoopProxy*);

  // NPChannelBase implementation:
  virtual int GenerateRouteID() OVERRIDE;

  // NPChannelBase override:
  virtual bool Init(base::MessageLoopProxy* ipc_message_loop,
                    bool create_pipe_now,
                    base::WaitableEvent* shutdown_event) OVERRIDE;
  virtual bool Send(IPC::Message* msg) OVERRIDE;

 private:
  JavaBridgeChannelHost() {}
  friend class base::RefCountedThreadSafe<JavaBridgeChannelHost>;
  virtual ~JavaBridgeChannelHost() {}

  static NPChannelBase* ClassFactory() {
    return new JavaBridgeChannelHost();
  }

  DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannelHost);
};

#endif  // CONTENT_BROWSER_RENDERER_HOST_JAVA_BRIDGE_CHANNEL_HOST_H_