summaryrefslogtreecommitdiffstats
path: root/third_party/libjingle
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 02:12:07 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 02:12:07 +0000
commit8d3f1d5056a621bed3dd431bd33a1fb535b27d81 (patch)
treea656bb0da2e4f38f759e184a86d5a273d1790802 /third_party/libjingle
parentb0c54878d30128f0aad207bf80a24426d619a6ed (diff)
downloadchromium_src-8d3f1d5056a621bed3dd431bd33a1fb535b27d81.zip
chromium_src-8d3f1d5056a621bed3dd431bd33a1fb535b27d81.tar.gz
chromium_src-8d3f1d5056a621bed3dd431bd33a1fb535b27d81.tar.bz2
Removed non-thread-safe QName ad-hoc interning.
BUG=43467 TEST=made sure sync_integration_tests don't have any more ~QName crashes Review URL: http://codereview.chromium.org/2012014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libjingle')
-rw-r--r--third_party/libjingle/files/talk/xmllite/qname.cc105
-rw-r--r--third_party/libjingle/files/talk/xmllite/qname.h40
-rw-r--r--third_party/libjingle/files/talk/xmllite/xmlelement.cc4
-rw-r--r--third_party/libjingle/files/talk/xmpp/saslcookiemechanism.h2
-rw-r--r--third_party/libjingle/files/talk/xmpp/xmppconstants.cc370
5 files changed, 208 insertions, 313 deletions
diff --git a/third_party/libjingle/files/talk/xmllite/qname.cc b/third_party/libjingle/files/talk/xmllite/qname.cc
index 08f6bd4..c60d0c0 100644
--- a/third_party/libjingle/files/talk/xmllite/qname.cc
+++ b/third_party/libjingle/files/talk/xmllite/qname.cc
@@ -35,80 +35,11 @@
namespace buzz {
-static int QName_Hash(const std::string & ns, const char * local) {
- int result = static_cast<int>(ns.size()) * 101;
- while (*local) {
- result *= 19;
- result += *local;
- local += 1;
- }
- return result;
-}
-
-static const int bits = 9;
-static QName::Data * get_qname_table() {
- static QName::Data qname_table[1 << bits];
- return qname_table;
-}
-
-static QName::Data *
-AllocateOrFind(const std::string & ns, const char * local) {
- int index = QName_Hash(ns, local);
- int increment = index >> (bits - 1) | 1;
- QName::Data * qname_table = get_qname_table();
- for (;;) {
- index &= ((1 << bits) - 1);
- if (!qname_table[index].Occupied()) {
- return new QName::Data(ns, local);
- }
- if (qname_table[index].localPart_ == local &&
- qname_table[index].namespace_ == ns) {
- qname_table[index].AddRef();
- return qname_table + index;
- }
- index += increment;
- }
-}
-
-static QName::Data *
-Add(const std::string & ns, const char * local) {
- int index = QName_Hash(ns, local);
- int increment = index >> (bits - 1) | 1;
- QName::Data * qname_table = get_qname_table();
- for (;;) {
- index &= ((1 << bits) - 1);
- if (!qname_table[index].Occupied()) {
- qname_table[index].namespace_ = ns;
- qname_table[index].localPart_ = local;
- qname_table[index].AddRef(); // AddRef twice so it's never deleted
- qname_table[index].AddRef();
- return qname_table + index;
- }
- if (qname_table[index].localPart_ == local &&
- qname_table[index].namespace_ == ns) {
- qname_table[index].AddRef();
- return qname_table + index;
- }
- index += increment;
- }
-}
-
-QName::~QName() {
- data_->Release();
-}
-
-QName::QName() : data_(QN_EMPTY.data_) {
- data_->AddRef();
-}
+QName::QName() : namespace_(QN_EMPTY.namespace_),
+ localPart_(QN_EMPTY.localPart_) {}
-QName::QName(bool add, const std::string & ns, const char * local) :
- data_(add ? Add(ns, local) : AllocateOrFind(ns, local)) {}
-
-QName::QName(bool add, const std::string & ns, const std::string & local) :
- data_(add ? Add(ns, local.c_str()) : AllocateOrFind(ns, local.c_str())) {}
-
-QName::QName(const std::string & ns, const char * local) :
- data_(AllocateOrFind(ns, local)) {}
+QName::QName(const std::string & ns, const std::string & local) :
+ namespace_(ns), localPart_(local) {}
static std::string
QName_LocalPart(const std::string & name) {
@@ -127,38 +58,30 @@ QName_Namespace(const std::string & name) {
}
QName::QName(const std::string & mergedOrLocal) :
- data_(AllocateOrFind(QName_Namespace(mergedOrLocal),
- QName_LocalPart(mergedOrLocal).c_str())) {}
+ namespace_(QName_Namespace(mergedOrLocal)),
+ localPart_(QName_LocalPart(mergedOrLocal)) {}
std::string
QName::Merged() const {
- if (data_->namespace_ == STR_EMPTY)
- return data_->localPart_;
-
- std::string result(data_->namespace_);
- result.reserve(result.length() + 1 + data_->localPart_.length());
- result += ':';
- result += data_->localPart_;
- return result;
+ if (namespace_ == STR_EMPTY)
+ return localPart_;
+ return namespace_ + ':' + localPart_;
}
bool
QName::operator==(const QName & other) const {
- return other.data_ == data_ ||
- data_->localPart_ == other.data_->localPart_ &&
- data_->namespace_ == other.data_->namespace_;
+ return
+ localPart_ == other.localPart_ &&
+ namespace_ == other.namespace_;
}
int
QName::Compare(const QName & other) const {
- if (data_ == other.data_)
- return 0;
-
- int result = data_->localPart_.compare(other.data_->localPart_);
+ int result = localPart_.compare(other.localPart_);
if (result)
return result;
- return data_->namespace_.compare(other.data_->namespace_);
+ return namespace_.compare(other.namespace_);
}
}
diff --git a/third_party/libjingle/files/talk/xmllite/qname.h b/third_party/libjingle/files/talk/xmllite/qname.h
index 3e64726..6600043 100644
--- a/third_party/libjingle/files/talk/xmllite/qname.h
+++ b/third_party/libjingle/files/talk/xmllite/qname.h
@@ -36,49 +36,21 @@ namespace buzz {
class QName
{
public:
- explicit QName();
- QName(const QName & qname) : data_(qname.data_) { data_->AddRef(); }
- explicit QName(bool add, const std::string & ns, const char * local);
- explicit QName(bool add, const std::string & ns, const std::string & local);
- explicit QName(const std::string & ns, const char * local);
+ QName();
+ QName(const std::string & ns, const std::string & local);
explicit QName(const std::string & mergedOrLocal);
- QName & operator=(const QName & qn) {
- qn.data_->AddRef();
- data_->Release();
- data_ = qn.data_;
- return *this;
- }
- ~QName();
- const std::string & Namespace() const { return data_->namespace_; }
- const std::string & LocalPart() const { return data_->localPart_; }
+ const std::string & Namespace() const { return namespace_; }
+ const std::string & LocalPart() const { return localPart_; }
std::string Merged() const;
int Compare(const QName & other) const;
bool operator==(const QName & other) const;
bool operator!=(const QName & other) const { return !operator==(other); }
bool operator<(const QName & other) const { return Compare(other) < 0; }
- class Data {
- public:
- Data(const std::string & ns, const std::string & local) :
- namespace_(ns),
- localPart_(local),
- refcount_(1) {}
-
- Data() : refcount_(0) {}
-
- std::string namespace_;
- std::string localPart_;
- void AddRef() { refcount_++; }
- void Release() { if (!--refcount_) { delete this; } }
- bool Occupied() { return !!refcount_; }
-
- private:
- int refcount_;
- };
-
private:
- Data * data_;
+ std::string namespace_;
+ std::string localPart_;
};
diff --git a/third_party/libjingle/files/talk/xmllite/xmlelement.cc b/third_party/libjingle/files/talk/xmllite/xmlelement.cc
index ba0a9a0..8c8611a 100644
--- a/third_party/libjingle/files/talk/xmllite/xmlelement.cc
+++ b/third_party/libjingle/files/talk/xmllite/xmlelement.cc
@@ -40,8 +40,8 @@
namespace buzz {
-const QName QN_EMPTY(true, STR_EMPTY, STR_EMPTY);
-const QName QN_XMLNS(true, STR_EMPTY, STR_XMLNS);
+const QName QN_EMPTY(STR_EMPTY, STR_EMPTY);
+const QName QN_XMLNS(STR_EMPTY, STR_XMLNS);
XmlChild::~XmlChild() {
diff --git a/third_party/libjingle/files/talk/xmpp/saslcookiemechanism.h b/third_party/libjingle/files/talk/xmpp/saslcookiemechanism.h
index 389b401..e3e4509 100644
--- a/third_party/libjingle/files/talk/xmpp/saslcookiemechanism.h
+++ b/third_party/libjingle/files/talk/xmpp/saslcookiemechanism.h
@@ -62,7 +62,7 @@ public:
el->AddAttr(QN_MECHANISM, mechanism_);
if (!token_service_.empty()) {
el->AddAttr(
- QName(true, "http://www.google.com/talk/protocol/auth", "service"),
+ QName("http://www.google.com/talk/protocol/auth", "service"),
token_service_);
}
diff --git a/third_party/libjingle/files/talk/xmpp/xmppconstants.cc b/third_party/libjingle/files/talk/xmpp/xmppconstants.cc
index 80e78ee..934d10e 100644
--- a/third_party/libjingle/files/talk/xmpp/xmppconstants.cc
+++ b/third_party/libjingle/files/talk/xmpp/xmppconstants.cc
@@ -153,143 +153,143 @@ const std::string STR_VOICEMAIL("voicemail");
const std::string STR_OUTGOINGVOICEMAIL("outgoingvoicemail");
#endif
-const QName QN_STREAM_STREAM(true, NS_STREAM, STR_STREAM);
-const QName QN_STREAM_FEATURES(true, NS_STREAM, "features");
-const QName QN_STREAM_ERROR(true, NS_STREAM, "error");
-
-const QName QN_XSTREAM_BAD_FORMAT(true, NS_XSTREAM, "bad-format");
-const QName QN_XSTREAM_BAD_NAMESPACE_PREFIX(true, NS_XSTREAM, "bad-namespace-prefix");
-const QName QN_XSTREAM_CONFLICT(true, NS_XSTREAM, "conflict");
-const QName QN_XSTREAM_CONNECTION_TIMEOUT(true, NS_XSTREAM, "connection-timeout");
-const QName QN_XSTREAM_HOST_GONE(true, NS_XSTREAM, "host-gone");
-const QName QN_XSTREAM_HOST_UNKNOWN(true, NS_XSTREAM, "host-unknown");
-const QName QN_XSTREAM_IMPROPER_ADDRESSIING(true, NS_XSTREAM, "improper-addressing");
-const QName QN_XSTREAM_INTERNAL_SERVER_ERROR(true, NS_XSTREAM, "internal-server-error");
-const QName QN_XSTREAM_INVALID_FROM(true, NS_XSTREAM, "invalid-from");
-const QName QN_XSTREAM_INVALID_ID(true, NS_XSTREAM, "invalid-id");
-const QName QN_XSTREAM_INVALID_NAMESPACE(true, NS_XSTREAM, "invalid-namespace");
-const QName QN_XSTREAM_INVALID_XML(true, NS_XSTREAM, "invalid-xml");
-const QName QN_XSTREAM_NOT_AUTHORIZED(true, NS_XSTREAM, "not-authorized");
-const QName QN_XSTREAM_POLICY_VIOLATION(true, NS_XSTREAM, "policy-violation");
-const QName QN_XSTREAM_REMOTE_CONNECTION_FAILED(true, NS_XSTREAM, "remote-connection-failed");
-const QName QN_XSTREAM_RESOURCE_CONSTRAINT(true, NS_XSTREAM, "resource-constraint");
-const QName QN_XSTREAM_RESTRICTED_XML(true, NS_XSTREAM, "restricted-xml");
-const QName QN_XSTREAM_SEE_OTHER_HOST(true, NS_XSTREAM, "see-other-host");
-const QName QN_XSTREAM_SYSTEM_SHUTDOWN(true, NS_XSTREAM, "system-shutdown");
-const QName QN_XSTREAM_UNDEFINED_CONDITION(true, NS_XSTREAM, "undefined-condition");
-const QName QN_XSTREAM_UNSUPPORTED_ENCODING(true, NS_XSTREAM, "unsupported-encoding");
-const QName QN_XSTREAM_UNSUPPORTED_STANZA_TYPE(true, NS_XSTREAM, "unsupported-stanza-type");
-const QName QN_XSTREAM_UNSUPPORTED_VERSION(true, NS_XSTREAM, "unsupported-version");
-const QName QN_XSTREAM_XML_NOT_WELL_FORMED(true, NS_XSTREAM, "xml-not-well-formed");
-const QName QN_XSTREAM_TEXT(true, NS_XSTREAM, "text");
-
-const QName QN_TLS_STARTTLS(true, NS_TLS, "starttls");
-const QName QN_TLS_REQUIRED(true, NS_TLS, "required");
-const QName QN_TLS_PROCEED(true, NS_TLS, "proceed");
-const QName QN_TLS_FAILURE(true, NS_TLS, "failure");
-
-const QName QN_SASL_MECHANISMS(true, NS_SASL, "mechanisms");
-const QName QN_SASL_MECHANISM(true, NS_SASL, "mechanism");
-const QName QN_SASL_AUTH(true, NS_SASL, "auth");
-const QName QN_SASL_CHALLENGE(true, NS_SASL, "challenge");
-const QName QN_SASL_RESPONSE(true, NS_SASL, "response");
-const QName QN_SASL_ABORT(true, NS_SASL, "abort");
-const QName QN_SASL_SUCCESS(true, NS_SASL, "success");
-const QName QN_SASL_FAILURE(true, NS_SASL, "failure");
-const QName QN_SASL_ABORTED(true, NS_SASL, "aborted");
-const QName QN_SASL_INCORRECT_ENCODING(true, NS_SASL, "incorrect-encoding");
-const QName QN_SASL_INVALID_AUTHZID(true, NS_SASL, "invalid-authzid");
-const QName QN_SASL_INVALID_MECHANISM(true, NS_SASL, "invalid-mechanism");
-const QName QN_SASL_MECHANISM_TOO_WEAK(true, NS_SASL, "mechanism-too-weak");
-const QName QN_SASL_NOT_AUTHORIZED(true, NS_SASL, "not-authorized");
-const QName QN_SASL_TEMPORARY_AUTH_FAILURE(true, NS_SASL, "temporary-auth-failure");
+const QName QN_STREAM_STREAM(NS_STREAM, STR_STREAM);
+const QName QN_STREAM_FEATURES(NS_STREAM, "features");
+const QName QN_STREAM_ERROR(NS_STREAM, "error");
+
+const QName QN_XSTREAM_BAD_FORMAT(NS_XSTREAM, "bad-format");
+const QName QN_XSTREAM_BAD_NAMESPACE_PREFIX(NS_XSTREAM, "bad-namespace-prefix");
+const QName QN_XSTREAM_CONFLICT(NS_XSTREAM, "conflict");
+const QName QN_XSTREAM_CONNECTION_TIMEOUT(NS_XSTREAM, "connection-timeout");
+const QName QN_XSTREAM_HOST_GONE(NS_XSTREAM, "host-gone");
+const QName QN_XSTREAM_HOST_UNKNOWN(NS_XSTREAM, "host-unknown");
+const QName QN_XSTREAM_IMPROPER_ADDRESSIING(NS_XSTREAM, "improper-addressing");
+const QName QN_XSTREAM_INTERNAL_SERVER_ERROR(NS_XSTREAM, "internal-server-error");
+const QName QN_XSTREAM_INVALID_FROM(NS_XSTREAM, "invalid-from");
+const QName QN_XSTREAM_INVALID_ID(NS_XSTREAM, "invalid-id");
+const QName QN_XSTREAM_INVALID_NAMESPACE(NS_XSTREAM, "invalid-namespace");
+const QName QN_XSTREAM_INVALID_XML(NS_XSTREAM, "invalid-xml");
+const QName QN_XSTREAM_NOT_AUTHORIZED(NS_XSTREAM, "not-authorized");
+const QName QN_XSTREAM_POLICY_VIOLATION(NS_XSTREAM, "policy-violation");
+const QName QN_XSTREAM_REMOTE_CONNECTION_FAILED(NS_XSTREAM, "remote-connection-failed");
+const QName QN_XSTREAM_RESOURCE_CONSTRAINT(NS_XSTREAM, "resource-constraint");
+const QName QN_XSTREAM_RESTRICTED_XML(NS_XSTREAM, "restricted-xml");
+const QName QN_XSTREAM_SEE_OTHER_HOST(NS_XSTREAM, "see-other-host");
+const QName QN_XSTREAM_SYSTEM_SHUTDOWN(NS_XSTREAM, "system-shutdown");
+const QName QN_XSTREAM_UNDEFINED_CONDITION(NS_XSTREAM, "undefined-condition");
+const QName QN_XSTREAM_UNSUPPORTED_ENCODING(NS_XSTREAM, "unsupported-encoding");
+const QName QN_XSTREAM_UNSUPPORTED_STANZA_TYPE(NS_XSTREAM, "unsupported-stanza-type");
+const QName QN_XSTREAM_UNSUPPORTED_VERSION(NS_XSTREAM, "unsupported-version");
+const QName QN_XSTREAM_XML_NOT_WELL_FORMED(NS_XSTREAM, "xml-not-well-formed");
+const QName QN_XSTREAM_TEXT(NS_XSTREAM, "text");
+
+const QName QN_TLS_STARTTLS(NS_TLS, "starttls");
+const QName QN_TLS_REQUIRED(NS_TLS, "required");
+const QName QN_TLS_PROCEED(NS_TLS, "proceed");
+const QName QN_TLS_FAILURE(NS_TLS, "failure");
+
+const QName QN_SASL_MECHANISMS(NS_SASL, "mechanisms");
+const QName QN_SASL_MECHANISM(NS_SASL, "mechanism");
+const QName QN_SASL_AUTH(NS_SASL, "auth");
+const QName QN_SASL_CHALLENGE(NS_SASL, "challenge");
+const QName QN_SASL_RESPONSE(NS_SASL, "response");
+const QName QN_SASL_ABORT(NS_SASL, "abort");
+const QName QN_SASL_SUCCESS(NS_SASL, "success");
+const QName QN_SASL_FAILURE(NS_SASL, "failure");
+const QName QN_SASL_ABORTED(NS_SASL, "aborted");
+const QName QN_SASL_INCORRECT_ENCODING(NS_SASL, "incorrect-encoding");
+const QName QN_SASL_INVALID_AUTHZID(NS_SASL, "invalid-authzid");
+const QName QN_SASL_INVALID_MECHANISM(NS_SASL, "invalid-mechanism");
+const QName QN_SASL_MECHANISM_TOO_WEAK(NS_SASL, "mechanism-too-weak");
+const QName QN_SASL_NOT_AUTHORIZED(NS_SASL, "not-authorized");
+const QName QN_SASL_TEMPORARY_AUTH_FAILURE(NS_SASL, "temporary-auth-failure");
const std::string NS_GOOGLE_AUTH_PROTOCOL("http://www.google.com/talk/protocol/auth");
-const QName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT(true, NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result");
+const QName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT(NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result");
const std::string NS_GOOGLE_AUTH("google:auth");
-const QName QN_MISSING_USERNAME(true, NS_GOOGLE_AUTH, "missing-username");
-const QName QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN(true, NS_GOOGLE_AUTH_PROTOCOL, "allow-generated-jid");
-
-const QName QN_DIALBACK_RESULT(true, NS_DIALBACK, "result");
-const QName QN_DIALBACK_VERIFY(true, NS_DIALBACK, "verify");
-
-const QName QN_STANZA_BAD_REQUEST(true, NS_STANZA, "bad-request");
-const QName QN_STANZA_CONFLICT(true, NS_STANZA, "conflict");
-const QName QN_STANZA_FEATURE_NOT_IMPLEMENTED(true, NS_STANZA, "feature-not-implemented");
-const QName QN_STANZA_FORBIDDEN(true, NS_STANZA, "forbidden");
-const QName QN_STANZA_GONE(true, NS_STANZA, "gone");
-const QName QN_STANZA_INTERNAL_SERVER_ERROR(true, NS_STANZA, "internal-server-error");
-const QName QN_STANZA_ITEM_NOT_FOUND(true, NS_STANZA, "item-not-found");
-const QName QN_STANZA_JID_MALFORMED(true, NS_STANZA, "jid-malformed");
-const QName QN_STANZA_NOT_ACCEPTABLE(true, NS_STANZA, "not-acceptable");
-const QName QN_STANZA_NOT_ALLOWED(true, NS_STANZA, "not-allowed");
-const QName QN_STANZA_PAYMENT_REQUIRED(true, NS_STANZA, "payment-required");
-const QName QN_STANZA_RECIPIENT_UNAVAILABLE(true, NS_STANZA, "recipient-unavailable");
-const QName QN_STANZA_REDIRECT(true, NS_STANZA, "redirect");
-const QName QN_STANZA_REGISTRATION_REQUIRED(true, NS_STANZA, "registration-required");
-const QName QN_STANZA_REMOTE_SERVER_NOT_FOUND(true, NS_STANZA, "remote-server-not-found");
-const QName QN_STANZA_REMOTE_SERVER_TIMEOUT(true, NS_STANZA, "remote-server-timeout");
-const QName QN_STANZA_RESOURCE_CONSTRAINT(true, NS_STANZA, "resource-constraint");
-const QName QN_STANZA_SERVICE_UNAVAILABLE(true, NS_STANZA, "service-unavailable");
-const QName QN_STANZA_SUBSCRIPTION_REQUIRED(true, NS_STANZA, "subscription-required");
-const QName QN_STANZA_UNDEFINED_CONDITION(true, NS_STANZA, "undefined-condition");
-const QName QN_STANZA_UNEXPECTED_REQUEST(true, NS_STANZA, "unexpected-request");
-const QName QN_STANZA_TEXT(true, NS_STANZA, "text");
-
-const QName QN_BIND_BIND(true, NS_BIND, "bind");
-const QName QN_BIND_RESOURCE(true, NS_BIND, "resource");
-const QName QN_BIND_JID(true, NS_BIND, "jid");
-
-const QName QN_MESSAGE(true, NS_CLIENT, "message");
-const QName QN_BODY(true, NS_CLIENT, "body");
-const QName QN_SUBJECT(true, NS_CLIENT, "subject");
-const QName QN_THREAD(true, NS_CLIENT, "thread");
-const QName QN_PRESENCE(true, NS_CLIENT, "presence");
-const QName QN_SHOW(true, NS_CLIENT, "show");
-const QName QN_STATUS(true, NS_CLIENT, "status");
-const QName QN_LANG(true, NS_CLIENT, "lang");
-const QName QN_PRIORITY(true, NS_CLIENT, "priority");
-const QName QN_IQ(true, NS_CLIENT, "iq");
-const QName QN_ERROR(true, NS_CLIENT, "error");
-
-const QName QN_SERVER_MESSAGE(true, NS_SERVER, "message");
-const QName QN_SERVER_BODY(true, NS_SERVER, "body");
-const QName QN_SERVER_SUBJECT(true, NS_SERVER, "subject");
-const QName QN_SERVER_THREAD(true, NS_SERVER, "thread");
-const QName QN_SERVER_PRESENCE(true, NS_SERVER, "presence");
-const QName QN_SERVER_SHOW(true, NS_SERVER, "show");
-const QName QN_SERVER_STATUS(true, NS_SERVER, "status");
-const QName QN_SERVER_LANG(true, NS_SERVER, "lang");
-const QName QN_SERVER_PRIORITY(true, NS_SERVER, "priority");
-const QName QN_SERVER_IQ(true, NS_SERVER, "iq");
-const QName QN_SERVER_ERROR(true, NS_SERVER, "error");
-
-const QName QN_SESSION_SESSION(true, NS_SESSION, "session");
-
-const QName QN_PRIVACY_QUERY(true, NS_PRIVACY, "query");
-const QName QN_PRIVACY_ACTIVE(true, NS_PRIVACY, "active");
-const QName QN_PRIVACY_DEFAULT(true, NS_PRIVACY, "default");
-const QName QN_PRIVACY_LIST(true, NS_PRIVACY, "list");
-const QName QN_PRIVACY_ITEM(true, NS_PRIVACY, "item");
-const QName QN_PRIVACY_IQ(true, NS_PRIVACY, "iq");
-const QName QN_PRIVACY_MESSAGE(true, NS_PRIVACY, "message");
-const QName QN_PRIVACY_PRESENCE_IN(true, NS_PRIVACY, "presence-in");
-const QName QN_PRIVACY_PRESENCE_OUT(true, NS_PRIVACY, "presence-out");
-
-const QName QN_ROSTER_QUERY(true, NS_ROSTER, "query");
-const QName QN_ROSTER_ITEM(true, NS_ROSTER, "item");
-const QName QN_ROSTER_GROUP(true, NS_ROSTER, "group");
-
-const QName QN_VCARD(true, NS_VCARD, "vCard");
-const QName QN_VCARD_FN(true, NS_VCARD, "FN");
-const QName QN_VCARD_PHOTO(true, NS_VCARD, "PHOTO");
-const QName QN_VCARD_PHOTO_BINVAL(true, NS_VCARD, "BINVAL");
-const QName QN_VCARD_AVATAR_HASH(true, NS_AVATAR_HASH, "hash");
-const QName QN_VCARD_AVATAR_HASH_MODIFIED(true, NS_AVATAR_HASH, "modified");
-
-const buzz::QName QN_NAME(true, STR_EMPTY, "name");
-const QName QN_XML_LANG(true, NS_XML, "lang");
+const QName QN_MISSING_USERNAME(NS_GOOGLE_AUTH, "missing-username");
+const QName QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN(NS_GOOGLE_AUTH_PROTOCOL, "allow-generated-jid");
+
+const QName QN_DIALBACK_RESULT(NS_DIALBACK, "result");
+const QName QN_DIALBACK_VERIFY(NS_DIALBACK, "verify");
+
+const QName QN_STANZA_BAD_REQUEST(NS_STANZA, "bad-request");
+const QName QN_STANZA_CONFLICT(NS_STANZA, "conflict");
+const QName QN_STANZA_FEATURE_NOT_IMPLEMENTED(NS_STANZA, "feature-not-implemented");
+const QName QN_STANZA_FORBIDDEN(NS_STANZA, "forbidden");
+const QName QN_STANZA_GONE(NS_STANZA, "gone");
+const QName QN_STANZA_INTERNAL_SERVER_ERROR(NS_STANZA, "internal-server-error");
+const QName QN_STANZA_ITEM_NOT_FOUND(NS_STANZA, "item-not-found");
+const QName QN_STANZA_JID_MALFORMED(NS_STANZA, "jid-malformed");
+const QName QN_STANZA_NOT_ACCEPTABLE(NS_STANZA, "not-acceptable");
+const QName QN_STANZA_NOT_ALLOWED(NS_STANZA, "not-allowed");
+const QName QN_STANZA_PAYMENT_REQUIRED(NS_STANZA, "payment-required");
+const QName QN_STANZA_RECIPIENT_UNAVAILABLE(NS_STANZA, "recipient-unavailable");
+const QName QN_STANZA_REDIRECT(NS_STANZA, "redirect");
+const QName QN_STANZA_REGISTRATION_REQUIRED(NS_STANZA, "registration-required");
+const QName QN_STANZA_REMOTE_SERVER_NOT_FOUND(NS_STANZA, "remote-server-not-found");
+const QName QN_STANZA_REMOTE_SERVER_TIMEOUT(NS_STANZA, "remote-server-timeout");
+const QName QN_STANZA_RESOURCE_CONSTRAINT(NS_STANZA, "resource-constraint");
+const QName QN_STANZA_SERVICE_UNAVAILABLE(NS_STANZA, "service-unavailable");
+const QName QN_STANZA_SUBSCRIPTION_REQUIRED(NS_STANZA, "subscription-required");
+const QName QN_STANZA_UNDEFINED_CONDITION(NS_STANZA, "undefined-condition");
+const QName QN_STANZA_UNEXPECTED_REQUEST(NS_STANZA, "unexpected-request");
+const QName QN_STANZA_TEXT(NS_STANZA, "text");
+
+const QName QN_BIND_BIND(NS_BIND, "bind");
+const QName QN_BIND_RESOURCE(NS_BIND, "resource");
+const QName QN_BIND_JID(NS_BIND, "jid");
+
+const QName QN_MESSAGE(NS_CLIENT, "message");
+const QName QN_BODY(NS_CLIENT, "body");
+const QName QN_SUBJECT(NS_CLIENT, "subject");
+const QName QN_THREAD(NS_CLIENT, "thread");
+const QName QN_PRESENCE(NS_CLIENT, "presence");
+const QName QN_SHOW(NS_CLIENT, "show");
+const QName QN_STATUS(NS_CLIENT, "status");
+const QName QN_LANG(NS_CLIENT, "lang");
+const QName QN_PRIORITY(NS_CLIENT, "priority");
+const QName QN_IQ(NS_CLIENT, "iq");
+const QName QN_ERROR(NS_CLIENT, "error");
+
+const QName QN_SERVER_MESSAGE(NS_SERVER, "message");
+const QName QN_SERVER_BODY(NS_SERVER, "body");
+const QName QN_SERVER_SUBJECT(NS_SERVER, "subject");
+const QName QN_SERVER_THREAD(NS_SERVER, "thread");
+const QName QN_SERVER_PRESENCE(NS_SERVER, "presence");
+const QName QN_SERVER_SHOW(NS_SERVER, "show");
+const QName QN_SERVER_STATUS(NS_SERVER, "status");
+const QName QN_SERVER_LANG(NS_SERVER, "lang");
+const QName QN_SERVER_PRIORITY(NS_SERVER, "priority");
+const QName QN_SERVER_IQ(NS_SERVER, "iq");
+const QName QN_SERVER_ERROR(NS_SERVER, "error");
+
+const QName QN_SESSION_SESSION(NS_SESSION, "session");
+
+const QName QN_PRIVACY_QUERY(NS_PRIVACY, "query");
+const QName QN_PRIVACY_ACTIVE(NS_PRIVACY, "active");
+const QName QN_PRIVACY_DEFAULT(NS_PRIVACY, "default");
+const QName QN_PRIVACY_LIST(NS_PRIVACY, "list");
+const QName QN_PRIVACY_ITEM(NS_PRIVACY, "item");
+const QName QN_PRIVACY_IQ(NS_PRIVACY, "iq");
+const QName QN_PRIVACY_MESSAGE(NS_PRIVACY, "message");
+const QName QN_PRIVACY_PRESENCE_IN(NS_PRIVACY, "presence-in");
+const QName QN_PRIVACY_PRESENCE_OUT(NS_PRIVACY, "presence-out");
+
+const QName QN_ROSTER_QUERY(NS_ROSTER, "query");
+const QName QN_ROSTER_ITEM(NS_ROSTER, "item");
+const QName QN_ROSTER_GROUP(NS_ROSTER, "group");
+
+const QName QN_VCARD(NS_VCARD, "vCard");
+const QName QN_VCARD_FN(NS_VCARD, "FN");
+const QName QN_VCARD_PHOTO(NS_VCARD, "PHOTO");
+const QName QN_VCARD_PHOTO_BINVAL(NS_VCARD, "BINVAL");
+const QName QN_VCARD_AVATAR_HASH(NS_AVATAR_HASH, "hash");
+const QName QN_VCARD_AVATAR_HASH_MODIFIED(NS_AVATAR_HASH, "modified");
+
+const buzz::QName QN_NAME(STR_EMPTY, "name");
+const QName QN_XML_LANG(NS_XML, "lang");
const std::string STR_TYPE("type");
const std::string STR_ID("id");
@@ -298,28 +298,28 @@ const std::string STR_JID("jid");
const std::string STR_SUBSCRIPTION("subscription");
const std::string STR_ASK("ask");
-const QName QN_ENCODING(true, STR_EMPTY, STR_ENCODING);
-const QName QN_VERSION(true, STR_EMPTY, STR_VERSION);
-const QName QN_TO(true, STR_EMPTY, "to");
-const QName QN_FROM(true, STR_EMPTY, "from");
-const QName QN_TYPE(true, STR_EMPTY, "type");
-const QName QN_ID(true, STR_EMPTY, "id");
-const QName QN_CODE(true, STR_EMPTY, "code");
+const QName QN_ENCODING(STR_EMPTY, STR_ENCODING);
+const QName QN_VERSION(STR_EMPTY, STR_VERSION);
+const QName QN_TO(STR_EMPTY, "to");
+const QName QN_FROM(STR_EMPTY, "from");
+const QName QN_TYPE(STR_EMPTY, "type");
+const QName QN_ID(STR_EMPTY, "id");
+const QName QN_CODE(STR_EMPTY, "code");
-const QName QN_VALUE(true, STR_EMPTY, "value");
-const QName QN_ACTION(true, STR_EMPTY, "action");
-const QName QN_ORDER(true, STR_EMPTY, "order");
-const QName QN_MECHANISM(true, STR_EMPTY, "mechanism");
-const QName QN_ASK(true, STR_EMPTY, "ask");
-const QName QN_JID(true, STR_EMPTY, "jid");
-const QName QN_SUBSCRIPTION(true, STR_EMPTY, "subscription");
-const QName QN_TITLE1(true, STR_EMPTY, "title1");
-const QName QN_TITLE2(true, STR_EMPTY, "title2");
-const QName QN_SOURCE(true, STR_EMPTY, "source");
+const QName QN_VALUE(STR_EMPTY, "value");
+const QName QN_ACTION(STR_EMPTY, "action");
+const QName QN_ORDER(STR_EMPTY, "order");
+const QName QN_MECHANISM(STR_EMPTY, "mechanism");
+const QName QN_ASK(STR_EMPTY, "ask");
+const QName QN_JID(STR_EMPTY, "jid");
+const QName QN_SUBSCRIPTION(STR_EMPTY, "subscription");
+const QName QN_TITLE1(STR_EMPTY, "title1");
+const QName QN_TITLE2(STR_EMPTY, "title2");
+const QName QN_SOURCE(STR_EMPTY, "source");
-const QName QN_XMLNS_CLIENT(true, NS_XMLNS, STR_CLIENT);
-const QName QN_XMLNS_SERVER(true, NS_XMLNS, STR_SERVER);
-const QName QN_XMLNS_STREAM(true, NS_XMLNS, STR_STREAM);
+const QName QN_XMLNS_CLIENT(NS_XMLNS, STR_CLIENT);
+const QName QN_XMLNS_SERVER(NS_XMLNS, STR_SERVER);
+const QName QN_XMLNS_STREAM(NS_XMLNS, STR_STREAM);
@@ -338,65 +338,65 @@ const std::string STR_UNSUBSCRIBED("unsubscribed");
// JEP 0030
-const QName QN_NODE(true, STR_EMPTY, "node");
-const QName QN_CATEGORY(true, STR_EMPTY, "category");
-const QName QN_VAR(true, STR_EMPTY, "var");
+const QName QN_NODE(STR_EMPTY, "node");
+const QName QN_CATEGORY(STR_EMPTY, "category");
+const QName QN_VAR(STR_EMPTY, "var");
const std::string NS_DISCO_INFO("http://jabber.org/protocol/disco#info");
const std::string NS_DISCO_ITEMS("http://jabber.org/protocol/disco#items");
-const QName QN_DISCO_INFO_QUERY(true, NS_DISCO_INFO, "query");
-const QName QN_DISCO_IDENTITY(true, NS_DISCO_INFO, "identity");
-const QName QN_DISCO_FEATURE(true, NS_DISCO_INFO, "feature");
+const QName QN_DISCO_INFO_QUERY(NS_DISCO_INFO, "query");
+const QName QN_DISCO_IDENTITY(NS_DISCO_INFO, "identity");
+const QName QN_DISCO_FEATURE(NS_DISCO_INFO, "feature");
-const QName QN_DISCO_ITEMS_QUERY(true, NS_DISCO_ITEMS, "query");
-const QName QN_DISCO_ITEM(true, NS_DISCO_ITEMS, "item");
+const QName QN_DISCO_ITEMS_QUERY(NS_DISCO_ITEMS, "query");
+const QName QN_DISCO_ITEM(NS_DISCO_ITEMS, "item");
// JEP 0115
const std::string NS_CAPS("http://jabber.org/protocol/caps");
-const QName QN_CAPS_C(true, NS_CAPS, "c");
-const QName QN_VER(true, STR_EMPTY, "ver");
-const QName QN_EXT(true, STR_EMPTY, "ext");
+const QName QN_CAPS_C(NS_CAPS, "c");
+const QName QN_VER(STR_EMPTY, "ver");
+const QName QN_EXT(STR_EMPTY, "ext");
// JEP 0153
const std::string kNSVCard("vcard-temp:x:update");
-const QName kQnVCardX(true, kNSVCard, "x");
-const QName kQnVCardPhoto(true, kNSVCard, "photo");
+const QName kQnVCardX(kNSVCard, "x");
+const QName kQnVCardPhoto(kNSVCard, "photo");
// JEP 0172 User Nickname
const std::string kNSNickname("http://jabber.org/protocol/nick");
-const QName kQnNickname(true, kNSNickname, "nick");
+const QName kQnNickname(kNSNickname, "nick");
// JEP 0085 chat state
const std::string NS_CHATSTATE("http://jabber.org/protocol/chatstates");
-const QName QN_CS_ACTIVE(true, NS_CHATSTATE, "active");
-const QName QN_CS_COMPOSING(true, NS_CHATSTATE, "composing");
-const QName QN_CS_PAUSED(true, NS_CHATSTATE, "paused");
-const QName QN_CS_INACTIVE(true, NS_CHATSTATE, "inactive");
-const QName QN_CS_GONE(true, NS_CHATSTATE, "gone");
+const QName QN_CS_ACTIVE(NS_CHATSTATE, "active");
+const QName QN_CS_COMPOSING(NS_CHATSTATE, "composing");
+const QName QN_CS_PAUSED(NS_CHATSTATE, "paused");
+const QName QN_CS_INACTIVE(NS_CHATSTATE, "inactive");
+const QName QN_CS_GONE(NS_CHATSTATE, "gone");
// JEP 0091 Delayed Delivery
const std::string kNSDelay("jabber:x:delay");
-const QName kQnDelayX(true, kNSDelay, "x");
-const QName kQnStamp(true, STR_EMPTY, "stamp");
+const QName kQnDelayX(kNSDelay, "x");
+const QName kQnStamp(STR_EMPTY, "stamp");
// Google time stamping (higher resolution)
const std::string kNSTimestamp("google:timestamp");
-const QName kQnTime(true, kNSTimestamp, "time");
-const QName kQnMilliseconds(true, STR_EMPTY, "ms");
+const QName kQnTime(kNSTimestamp, "time");
+const QName kQnMilliseconds(STR_EMPTY, "ms");
// Jingle Info
const std::string NS_JINGLE_INFO("google:jingleinfo");
-const QName QN_JINGLE_INFO_QUERY(true, NS_JINGLE_INFO, "query");
-const QName QN_JINGLE_INFO_STUN(true, NS_JINGLE_INFO, "stun");
-const QName QN_JINGLE_INFO_RELAY(true, NS_JINGLE_INFO, "relay");
-const QName QN_JINGLE_INFO_SERVER(true, NS_JINGLE_INFO, "server");
-const QName QN_JINGLE_INFO_TOKEN(true, NS_JINGLE_INFO, "token");
-const QName QN_JINGLE_INFO_HOST(true, STR_EMPTY, "host");
-const QName QN_JINGLE_INFO_TCP(true, STR_EMPTY, "tcp");
-const QName QN_JINGLE_INFO_UDP(true, STR_EMPTY, "udp");
-const QName QN_JINGLE_INFO_TCPSSL(true, STR_EMPTY, "tcpssl");
+const QName QN_JINGLE_INFO_QUERY(NS_JINGLE_INFO, "query");
+const QName QN_JINGLE_INFO_STUN(NS_JINGLE_INFO, "stun");
+const QName QN_JINGLE_INFO_RELAY(NS_JINGLE_INFO, "relay");
+const QName QN_JINGLE_INFO_SERVER(NS_JINGLE_INFO, "server");
+const QName QN_JINGLE_INFO_TOKEN(NS_JINGLE_INFO, "token");
+const QName QN_JINGLE_INFO_HOST(STR_EMPTY, "host");
+const QName QN_JINGLE_INFO_TCP(STR_EMPTY, "tcp");
+const QName QN_JINGLE_INFO_UDP(STR_EMPTY, "udp");
+const QName QN_JINGLE_INFO_TCPSSL(STR_EMPTY, "tcpssl");
}