本文整理汇总了C++中wtf::RefPtr::setBridge方法的典型用法代码示例。如果您正苦于以下问题:C++ RefPtr::setBridge方法的具体用法?C++ RefPtr::setBridge怎么用?C++ RefPtr::setBridge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wtf::RefPtr
的用法示例。
在下文中一共展示了RefPtr::setBridge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readItemRecursive
//.........这里部分代码省略.........
if ((end < data) || ((size_t)(end - data) < formDataSize)) {
ALOGW("\tNot enough data to read form data; returning");
return false;
}
formData = WebCore::FormData::create(data, formDataSize);
data += formDataSize;
// Read the identifier
int64_t id;
if (!readInt64(data, end, id, "Form id"))
return false;
if (id)
formData->setIdentifier(id);
}
// Set up the form info
if (formData != NULL) {
WebCore::ResourceRequest r;
r.setHTTPMethod("POST");
r.setHTTPContentType(formContentType);
r.setHTTPBody(formData);
newItem->setFormInfoFromRequest(r);
}
// Read the target
if (readString(data, end, content, "Target"))
newItem->setTarget(content);
else
return false;
AndroidWebHistoryBridge* bridge = newItem->bridge();
ALOG_ASSERT(bridge, "There should be a bridge object during inflate");
// Read the screen scale
float fValue;
if (readFloat(data, end, fValue, "Screen scale"))
bridge->setScale(fValue);
else
return false;
// Read the text wrap scale
if (readFloat(data, end, fValue, "Text wrap scale"))
bridge->setTextWrapScale(fValue);
else
return false;
// Read scroll position.
int scrollX;
if (!readInt(data, end, scrollX, "Scroll pos x"))
return false;
int scrollY;
if (!readInt(data, end, scrollY, "Scroll pos y"))
return false;
newItem->setScrollPoint(IntPoint(scrollX, scrollY));
// Read the document state
unsigned docStateCount;
if (!readUnsigned(data, end, docStateCount, "Doc state count"))
return false;
if (docStateCount) {
// Create a new vector and reserve enough space for the document state.
WTF::Vector<WTF::String> docState;
docState.reserveCapacity(docStateCount);
while (docStateCount--) {
// Read a document state string
if (readString(data, end, content, "Document state"))
docState.append(content);
else
return false;
}
newItem->setDocumentState(docState);
}
// Read is target item
bool c;
if (readBool(data, end, c, "Target item"))
newItem->setIsTargetItem(c);
else
return false;
// Read the child count
unsigned count;
if (!readUnsigned(data, end, count, "Child count"))
return false;
*pData = data;
if (count) {
while (count--) {
// No need to check the length each time because read_item_recursive
// will return null if there isn't enough data left to parse.
WTF::RefPtr<WebCore::HistoryItem> child = WebCore::HistoryItem::create();
// Set a bridge that will not call into java.
child->setBridge(new WebHistoryItem(static_cast<WebHistoryItem*>(bridge)));
// Read the child item.
if (!readItemRecursive(child.get(), pData, end - data))
return false;
child->bridge()->setActive();
newItem->addChildItem(child);
}
}
return true;
}