Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / browser / renderer_host / java / java_bridge_channel_host.h
blob3f3f1468e9b7045fdceef42dc90586b58ce049a9
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_
8 #include "content/child/npapi/np_channel_base.h"
10 namespace content {
12 class JavaBridgeChannelHost : public NPChannelBase {
13 public:
14 static JavaBridgeChannelHost* GetJavaBridgeChannelHost(
15 int renderer_id,
16 base::MessageLoopProxy* ipc_message_loop);
18 // A threadsafe function to generate a unique route ID. Used by the
19 // JavaBridgeDispatcherHost on the UI thread and this class on the Java
20 // Bridge's background thread.
21 static int ThreadsafeGenerateRouteID();
23 // NPChannelBase implementation:
24 virtual int GenerateRouteID() OVERRIDE;
26 // NPChannelBase override:
27 virtual bool Init(base::MessageLoopProxy* ipc_message_loop,
28 bool create_pipe_now,
29 base::WaitableEvent* shutdown_event) OVERRIDE;
31 protected:
32 // NPChannelBase override:
33 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
35 private:
36 JavaBridgeChannelHost() {}
37 friend class base::RefCountedThreadSafe<JavaBridgeChannelHost>;
38 virtual ~JavaBridgeChannelHost();
40 static NPChannelBase* ClassFactory() {
41 return new JavaBridgeChannelHost();
44 // Message handlers
45 void OnGenerateRouteID(int* route_id);
47 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannelHost);
50 } // namespace content
52 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_