Fix build break
[chromium-blink-merge.git] / content / renderer / media / rtc_data_channel_handler.h
blob2047ffe909cd7d080886a36282d8fd02e57ed11e
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_RENDERER_MEDIA_RTC_DATA_CHANNEL_HANDLER_H_
6 #define CONTENT_RENDERER_MEDIA_RTC_DATA_CHANNEL_HANDLER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/threading/non_thread_safe.h"
10 #include "content/common/content_export.h"
11 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h"
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCDataChannelHandler.h"
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCDataChannelHandlerClient.h"
15 namespace content {
17 // RtcDataChannelHandler is a delegate for the RTC PeerConnection DataChannel
18 // API messages going between WebKit and native PeerConnection DataChannels in
19 // libjingle. Instances of this class are owned by WebKit.
20 // WebKit call all of these methods on the main render thread.
21 // Callbacks to the webrtc::DataChannelObserver implementation also occur on
22 // the main render thread.
23 class CONTENT_EXPORT RtcDataChannelHandler
24 : NON_EXPORTED_BASE(public WebKit::WebRTCDataChannelHandler),
25 NON_EXPORTED_BASE(public webrtc::DataChannelObserver),
26 NON_EXPORTED_BASE(public base::NonThreadSafe) {
27 public:
28 explicit RtcDataChannelHandler(webrtc::DataChannelInterface* channel);
29 virtual ~RtcDataChannelHandler();
31 // WebKit::WebRTCDataChannelHandler implementation.
32 virtual void setClient(
33 WebKit::WebRTCDataChannelHandlerClient* client) OVERRIDE;
34 virtual WebKit::WebString label() OVERRIDE;
35 virtual bool isReliable() OVERRIDE;
36 virtual unsigned long bufferedAmount() OVERRIDE;
37 virtual bool sendStringData(const WebKit::WebString& data) OVERRIDE;
38 virtual bool sendRawData(const char* data, size_t length) OVERRIDE;
39 virtual void close() OVERRIDE;
41 // webrtc::DataChannelObserver implementation.
42 virtual void OnStateChange() OVERRIDE;
43 virtual void OnMessage(const webrtc::DataBuffer& buffer) OVERRIDE;
45 private:
46 scoped_refptr<webrtc::DataChannelInterface> channel_;
47 WebKit::WebRTCDataChannelHandlerClient* webkit_client_;
50 } // namespace content
52 #endif // CONTENT_RENDERER_MEDIA_RTC_DATA_CHANNEL_HANDLER_H_