mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update source files for bracket style
This commit is contained in:
@ -24,8 +24,9 @@ class CefXmlObjectLoader {
|
||||
const CefString& URI) {
|
||||
CefRefPtr<CefXmlReader> reader(
|
||||
CefXmlReader::Create(stream, encodingType, URI));
|
||||
if (!reader.get())
|
||||
if (!reader.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = reader->MoveToNextNode();
|
||||
if (ret) {
|
||||
@ -170,8 +171,9 @@ bool CefXmlObject::Load(CefRefPtr<CefStreamReader> stream,
|
||||
|
||||
CefXmlObjectLoader loader(this);
|
||||
if (!loader.Load(stream, encodingType, URI)) {
|
||||
if (loadError)
|
||||
if (loadError) {
|
||||
*loadError = loader.GetLoadError();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -194,8 +196,9 @@ void CefXmlObject::Append(CefRefPtr<CefXmlObject> object,
|
||||
ObjectVector children;
|
||||
object->GetChildren(children);
|
||||
ObjectVector::const_iterator it = children.begin();
|
||||
for (; it != children.end(); ++it)
|
||||
for (; it != children.end(); ++it) {
|
||||
AddChild((*it)->Duplicate());
|
||||
}
|
||||
}
|
||||
|
||||
if (object->HasAttributes()) {
|
||||
@ -203,8 +206,9 @@ void CefXmlObject::Append(CefRefPtr<CefXmlObject> object,
|
||||
object->GetAttributes(attributes);
|
||||
AttributeMap::const_iterator it = attributes.begin();
|
||||
for (; it != attributes.end(); ++it) {
|
||||
if (overwriteAttributes || !HasAttribute(it->first))
|
||||
if (overwriteAttributes || !HasAttribute(it->first)) {
|
||||
SetAttributeValue(it->first, it->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -235,8 +239,9 @@ CefString CefXmlObject::GetName() {
|
||||
|
||||
bool CefXmlObject::SetName(const CefString& name) {
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
if (name.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
name_ = name;
|
||||
@ -274,8 +279,9 @@ CefString CefXmlObject::GetValue() {
|
||||
bool CefXmlObject::SetValue(const CefString& value) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
DCHECK(children_.empty());
|
||||
if (!children_.empty())
|
||||
if (!children_.empty()) {
|
||||
return false;
|
||||
}
|
||||
value_ = value;
|
||||
return true;
|
||||
}
|
||||
@ -291,8 +297,9 @@ size_t CefXmlObject::GetAttributeCount() {
|
||||
}
|
||||
|
||||
bool CefXmlObject::HasAttribute(const CefString& name) {
|
||||
if (name.empty())
|
||||
if (name.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
AttributeMap::const_iterator it = attributes_.find(name);
|
||||
@ -305,8 +312,9 @@ CefString CefXmlObject::GetAttributeValue(const CefString& name) {
|
||||
if (!name.empty()) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
AttributeMap::const_iterator it = attributes_.find(name);
|
||||
if (it != attributes_.end())
|
||||
if (it != attributes_.end()) {
|
||||
value = it->second;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@ -314,8 +322,9 @@ CefString CefXmlObject::GetAttributeValue(const CefString& name) {
|
||||
bool CefXmlObject::SetAttributeValue(const CefString& name,
|
||||
const CefString& value) {
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
if (name.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
AttributeMap::iterator it = attributes_.find(name);
|
||||
@ -354,21 +363,24 @@ bool CefXmlObject::HasChild(CefRefPtr<CefXmlObject> child) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
ObjectVector::const_iterator it = children_.begin();
|
||||
for (; it != children_.end(); ++it) {
|
||||
if ((*it).get() == child.get())
|
||||
if ((*it).get() == child.get()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CefXmlObject::AddChild(CefRefPtr<CefXmlObject> child) {
|
||||
DCHECK(child.get());
|
||||
if (!child.get())
|
||||
if (!child.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefXmlObject> parent = child->GetParent();
|
||||
DCHECK(!parent);
|
||||
if (parent)
|
||||
if (parent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
|
||||
@ -401,21 +413,24 @@ size_t CefXmlObject::GetChildren(ObjectVector& children) {
|
||||
void CefXmlObject::ClearChildren() {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
ObjectVector::iterator it = children_.begin();
|
||||
for (; it != children_.end(); ++it)
|
||||
for (; it != children_.end(); ++it) {
|
||||
(*it)->SetParent(nullptr);
|
||||
}
|
||||
children_.clear();
|
||||
}
|
||||
|
||||
CefRefPtr<CefXmlObject> CefXmlObject::FindChild(const CefString& name) {
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
if (name.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
ObjectVector::const_iterator it = children_.begin();
|
||||
for (; it != children_.end(); ++it) {
|
||||
if ((*it)->GetName() == name)
|
||||
if ((*it)->GetName() == name) {
|
||||
return (*it);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -423,8 +438,9 @@ CefRefPtr<CefXmlObject> CefXmlObject::FindChild(const CefString& name) {
|
||||
size_t CefXmlObject::FindChildren(const CefString& name,
|
||||
ObjectVector& children) {
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
if (name.empty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t ct = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user