本文整理汇总了C++中wtf::PassRefPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PassRefPtr::get方法的具体用法?C++ PassRefPtr::get怎么用?C++ PassRefPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wtf::PassRefPtr
的用法示例。
在下文中一共展示了PassRefPtr::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWindow
Page* ChromeClientAndroid::createWindow(Frame* frame, const FrameLoadRequest&,
const WindowFeatures& features)
{
ASSERT(frame);
#ifdef ANDROID_MULTIPLE_WINDOWS
if (frame->settings() && !(frame->settings()->supportMultipleWindows()))
// If the client doesn't support multiple windows, just return the current page
return frame->page();
#endif
WTF::PassRefPtr<WebCore::Screen> screen = WebCore::Screen::create(frame);
bool dialog = features.dialog || !features.resizable
|| (features.heightSet && features.height < screen.get()->height()
&& features.widthSet && features.width < screen.get()->width())
|| (!features.menuBarVisible && !features.statusBarVisible
&& !features.toolBarVisible && !features.locationBarVisible
&& !features.scrollbarsVisible);
// fullscreen definitely means no dialog
if (features.fullscreen)
dialog = false;
WebCore::Frame* newFrame = m_webFrame->createWindow(dialog,
frame->script()->processingUserGesture());
if (newFrame) {
WebCore::Page* page = newFrame->page();
page->setGroupName(frame->page()->groupName());
return page;
}
return NULL;
}
示例2: unregisterNode
void SamplerApollo::unregisterNode(WTF::PassRefPtr<BaseSamplerNode> node)
{
ASSERT(node.get());
// invalidate the cached node if it is going to be deleted
if (m_cachedSearchNode.get() == node.get())
m_cachedSearchNode.clear();
m_liveNodes.remove(node->ptr());
m_liveNodesByIdentifier.remove(node->identifier());
#if !ENABLE(JIT)
// the references from RefPtr
ASSERT(node->hasOneRef());
#endif
// when sampling is stopped don't bother to keep the dead object.
if (samplerWillDeallocate(node.get())) {
WTF::PassRefPtr<DeadSamplerNode> deadNode = DeadSamplerNode::createWithDataFrom(node.get());
ASSERT(deadNode->hasOneRef());
m_deadNodesByIdentifier.add(node->identifier(), deadNode.get());
}
#if ENABLE(JIT)
node->clearPtr();
#endif
}
示例3: registerJSCell
void SamplerApollo::registerJSCell(JSGlobalObject* globalObject, JSCell* cell, size_t size)
{
WTF::PassRefPtr<SamplerJSCellNode> constructorNode = m_constructorNode.release();
if (UNLIKELY(!samplingNow))
return;
uint64_t globalObjectIdentifier = 0;
if (globalObject) {
BaseSamplerNode* globalObjectSample = getSamplerNodeFor(globalObject);
if (globalObjectSample)
globalObjectIdentifier = globalObjectSample->identifier();
}
PassRefPtr<SamplerJSCellNode> samplerNodeRef = adoptRef(new SamplerJSCellNode(globalObjectIdentifier, cell, size));
SamplerJSCellNode *samplerNode = samplerNodeRef.get();
if (registerNode(samplerNodeRef)) {
// cannot check the type because we are called directly from operator new
if (constructorNode.get() /* && cell->isObject() */) {
JSCell * const cell = constructorNode->impl();
// we don't want to make standard objects to show like Functions
// Internal construct for String,Boolean,... inherits directly InternalFunctions
if (! (cell && cell->getObject() && cell->getObject()->inherits(&InternalFunction::info) && !cell->getObject()->inherits(&JSFunction::info)) ) {
// try to set the name from the function
samplerNode->setObjectType(constructorNode->name());
}
}
}
}
示例4: registerNode
bool SamplerApollo::registerNode(WTF::PassRefPtr<BaseSamplerNode> node)
{
if (UNLIKELY(!samplingNow))
return false;
// check if the object was allocated earlier or if maybe the old object
// didn't trigger deallocation
ASSERT(getSamplerNodeFor(node->ptr()) == 0);
const uint64_t identifier = samplerDidAllocate(node.get());
if (identifier) {
node->setIdentifier(identifier);
m_liveNodes.add(node->ptr(), node.get());
m_liveNodesByIdentifier.add(node->identifier(), node.get());
// the references from liveNodes maps + pass ref ptr
ASSERT(node->refCount() == 3);
return true;
}
return false;
}
示例5: getData
JSValue JSClipboard::getData(ExecState* exec, const ArgList& args)
{
// FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments.
if (args.size() != 1)
return throwError(exec, SyntaxError, "getData: Invalid number of arguments");
Clipboard* const clipboard = impl();
bool success;
String const mimeType = ustringToString(args.at(0).toString(exec));
if (mimeType == ClipboardApolloHelper::BITMAP_TYPE) {
WTF::PassRefPtr<Node> result = clipboard->getDataNode(mimeType, success);
return success ? toJS(exec, result.get()) : jsUndefined();
} else {
JSValue const result = clipboard->getDataValue(mimeType, success);
return success ? result : jsUndefined();
}
}
示例6: read_item_recursive
//.........这里部分代码省略.........
if (l) {
LOGV("Form data %d %.*s", l, l, data);
if (data + l < end)
formData = WebCore::FormData::create(data, l);
else
return false;
data += l;
// Read the identifier
{
int64_t id;
int size = (int)sizeof(int64_t);
memcpy(&id, data, size);
data += size;
if (id)
formData->setIdentifier(id);
}
}
if (end - data < sizeofUnsigned)
return false;
// 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
memcpy(&l, data, sizeofUnsigned);
data += sizeofUnsigned;
if (l) {
LOGV("Target %d %.*s", l, l, data);
if (data + l < end)
newItem->setTarget(e.decode(data, l));
else
return false;
data += l;
}
if (end - data < sizeofUnsigned)
return false;
AndroidWebHistoryBridge* bridge = newItem->bridge();
LOG_ASSERT(bridge, "There should be a bridge object during inflate");
// Read the screen scale
memcpy(&l, data, sizeofUnsigned);
LOGV("Screen scale %d", l);
bridge->setScale(l);
data += sizeofUnsigned;
memcpy(&l, data, sizeofUnsigned);
LOGV("Screen width scale %d", l);
bridge->setScreenWidthScale(l);
data += sizeofUnsigned;
if (end - data < sizeofUnsigned)
return false;
// Read the document state
memcpy(&l, data, sizeofUnsigned);
LOGV("Document state %d", l);
data += sizeofUnsigned;
if (l) {
// Check if we have enough data to at least parse the sizes of each
// document state string.
if (data + l * sizeofUnsigned >= end)
示例7: sendNewFrame
void CanvasDrawListener::sendNewFrame(const WTF::PassRefPtr<SkImage>& image)
{
m_handler->sendNewFrame(image.get());
}