move xmpp and p2p to webrtc
Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and webrtc/p2p. Also makes libjingle use those version instead of the one in the talk folder. BUG=3379 Review URL: https://webrtc-codereview.appspot.com/26999004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7549 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
78
webrtc/p2p/base/sessionclient.h
Normal file
78
webrtc/p2p/base/sessionclient.h
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_P2P_BASE_SESSIONCLIENT_H_
|
||||
#define WEBRTC_P2P_BASE_SESSIONCLIENT_H_
|
||||
|
||||
#include "webrtc/p2p/base/constants.h"
|
||||
|
||||
namespace buzz {
|
||||
class XmlElement;
|
||||
}
|
||||
|
||||
namespace cricket {
|
||||
|
||||
struct ParseError;
|
||||
class Session;
|
||||
class ContentDescription;
|
||||
|
||||
class ContentParser {
|
||||
public:
|
||||
virtual bool ParseContent(SignalingProtocol protocol,
|
||||
const buzz::XmlElement* elem,
|
||||
ContentDescription** content,
|
||||
ParseError* error) = 0;
|
||||
// If not IsWriteable, then a given content should be "skipped" when
|
||||
// writing in the given protocol, as if it didn't exist. We assume
|
||||
// most things are writeable. We do this to avoid strange cases
|
||||
// like data contents in Gingle, which aren't writable.
|
||||
virtual bool IsWritable(SignalingProtocol protocol,
|
||||
const ContentDescription* content) {
|
||||
return true;
|
||||
}
|
||||
virtual bool WriteContent(SignalingProtocol protocol,
|
||||
const ContentDescription* content,
|
||||
buzz::XmlElement** elem,
|
||||
WriteError* error) = 0;
|
||||
virtual ~ContentParser() {}
|
||||
};
|
||||
|
||||
// A SessionClient exists in 1-1 relation with each session. The implementor
|
||||
// of this interface is the one that understands *what* the two sides are
|
||||
// trying to send to one another. The lower-level layers only know how to send
|
||||
// data; they do not know what is being sent.
|
||||
class SessionClient : public ContentParser {
|
||||
public:
|
||||
// Notifies the client of the creation / destruction of sessions of this type.
|
||||
//
|
||||
// IMPORTANT: The SessionClient, in its handling of OnSessionCreate, must
|
||||
// create whatever channels are indicate in the description. This is because
|
||||
// the remote client may already be attempting to connect those channels. If
|
||||
// we do not create our channel right away, then connection may fail or be
|
||||
// delayed.
|
||||
virtual void OnSessionCreate(Session* session, bool received_initiate) = 0;
|
||||
virtual void OnSessionDestroy(Session* session) = 0;
|
||||
|
||||
virtual bool ParseContent(SignalingProtocol protocol,
|
||||
const buzz::XmlElement* elem,
|
||||
ContentDescription** content,
|
||||
ParseError* error) = 0;
|
||||
virtual bool WriteContent(SignalingProtocol protocol,
|
||||
const ContentDescription* content,
|
||||
buzz::XmlElement** elem,
|
||||
WriteError* error) = 0;
|
||||
protected:
|
||||
// The SessionClient interface explicitly does not include destructor
|
||||
virtual ~SessionClient() { }
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // WEBRTC_P2P_BASE_SESSIONCLIENT_H_
|
||||
Reference in New Issue
Block a user