当前位置: 首页>>代码示例>>C++>>正文


C++ wtf::PassRefPtr类代码示例

本文整理汇总了C++中wtf::PassRefPtr的典型用法代码示例。如果您正苦于以下问题:C++ PassRefPtr类的具体用法?C++ PassRefPtr怎么用?C++ PassRefPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PassRefPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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());
			}
        }
    }
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:32,代码来源:SamplerApollo.cpp

示例2: runOpenPanel

void ChromeClientBlackBerry::runOpenPanel(WebCore::Frame*, WTF::PassRefPtr<WebCore::FileChooser> chooser)
{
    SharedArray<WebString> initialFiles;
    unsigned int initialFileSize = chooser->filenames().size();
    if (initialFileSize > 0)
        initialFiles.reset(new WebString[initialFileSize]);
    for (unsigned i = 0; i < initialFileSize; ++i)
        initialFiles[i] = chooser->filenames()[i];

    SharedArray<WebString> chosenFiles;
    unsigned int chosenFileSize;

    {
        PageGroupLoadDeferrer deferrer(m_webPage->d->m_page, true);
        TimerBase::fireTimersInNestedEventLoop();

        if (!m_webPage->client()->chooseFilenames(chooser->allowsMultipleFiles(), chooser->acceptTypes(), initialFiles, initialFileSize, chosenFiles, chosenFileSize))
            return;
    }

    Vector<WTF::String> files(chosenFileSize);
    for (unsigned i = 0; i < chosenFileSize; ++i)
        files[i] = chosenFiles[i];
    chooser->chooseFiles(files);
}
开发者ID:,项目名称:,代码行数:25,代码来源:

示例3: 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;
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例4: swapPlugin

//SanJose++    
    void swapPlugin(RenderWidget* renderer, bool isFocused) {
//SanJose--
        typedef FrameLoaderClientAndroid FLCA;
        FLCA* client = static_cast<FLCA*>(m_parent->loader()->client());
        client->enableOnDemandPlugins();
        WTF::PassRefPtr<PluginView> prpWidget =
                PluginView::create(m_parent.get(),
                                   m_size,
                                   m_element,
                                   m_url,
                                   m_paramNames,
                                   m_paramValues,
                                   m_mimeType,
                                   m_loadManually);
        RefPtr<Widget> myProtector(this);
//SanJose++
//When on demand is on and flash is loaded by clicking the PluginToggleWidget, sroll deost work
//on flash objects. 
//ex: aftonbladet.se. This happens because when the flash is selected for download, ALL flash 
//objects are set to be focused through the following API. None of flash objects is set to be 
//focused (due to no selection) when "always on" is enabled, in which case scroll has no problem.
//FIX: Only set focus for the flash object user explicitly selected when flash is downloaded manually.
        if (isFocused) {
        prpWidget->focusPluginElement();
        }
//SanJose--
        renderer->setWidget(prpWidget);
    }
开发者ID:federivas,项目名称:s6500d_official_platform,代码行数:29,代码来源:FrameLoaderClientAndroid.cpp

示例5: requestCheckingOfString

void EditorClientImpl::requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest> request)
{
    if (m_webView->spellCheckClient()) {
        const String& text = request->data().text();
        const Vector<uint32_t>& markers = request->data().markers();
        const Vector<unsigned>& markerOffsets = request->data().offsets();
        m_webView->spellCheckClient()->requestCheckingOfText(text, markers, markerOffsets, new WebTextCheckingCompletionImpl(request));
    }
}
开发者ID:windyuuy,项目名称:opera,代码行数:9,代码来源:EditorClientImpl.cpp

示例6: loadResourceIntoArray

WTF::PassRefPtr<Image> Image::loadPlatformResource(const char* name)
{
    Vector<char> array = loadResourceIntoArray(name);
    WTF::PassRefPtr<BitmapImage> image = BitmapImage::create();
    RefPtr<SharedBuffer> buffer = SharedBuffer::create(array.data(), array.size());
    image->setData(buffer, true);

    return image;
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例7: requestCheckingOfString

void EditorClientImpl::requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest> request)
{
    if (m_webView->spellCheckClient()) {
        String text = request->text();
        m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(request));
    }
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例8: source

JSC::EvalExecutable *QScriptProgramPrivate::executable(JSC::ExecState *exec,
                                                       QScriptEnginePrivate *eng)
{
    if (_executable) {
        if (eng == engine)
            return _executable.get();
        _executable = 0;
    }
    WTF::PassRefPtr<QScript::UStringSourceProviderWithFeedback> provider
        = QScript::UStringSourceProviderWithFeedback::create(sourceCode, fileName, firstLineNumber, eng);
    sourceId = provider->asID();
    JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null.
    _executable = JSC::EvalExecutable::create(exec, source);
    engine = eng;
    isCompiled = false;
    return _executable.get();
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:17,代码来源:qscriptprogram.cpp

示例9: 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();
    }
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:18,代码来源:JSClipboardCustomApollo.cpp

示例10: shim

JSC::EvalExecutable *QScriptProgramPrivate::executable(JSC::ExecState *exec,
                                                       QScriptEnginePrivate *eng)
{
    if (_executable) {
        if (eng == engine)
            return _executable.get();
        // "Migrating" to another engine; clean up old state
        QScript::APIShim shim(engine);
        _executable.clear();
        engine->unregisterScriptProgram(this);
    }
    WTF::PassRefPtr<QScript::UStringSourceProviderWithFeedback> provider
        = QScript::UStringSourceProviderWithFeedback::create(sourceCode, fileName, firstLineNumber, eng);
    sourceId = provider->asID();
    JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null.
    _executable = JSC::EvalExecutable::create(exec, source);
    engine = eng;
    engine->registerScriptProgram(this);
    isCompiled = false;
    return _executable.get();
}
开发者ID:sicily,项目名称:qt4.8.4,代码行数:21,代码来源:qscriptprogram.cpp

示例11: 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;
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:20,代码来源:SamplerApollo.cpp

示例12:

WebSecurityOrigin::WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>& origin)
    : m_private(static_cast<WebSecurityOriginPrivate*>(origin.releaseRef()))
{
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:4,代码来源:WebSecurityOrigin.cpp

示例13: read_item_recursive

static bool read_item_recursive(WebCore::HistoryItem* newItem,
        const char** pData, int length)
{
    if (!pData || length < HISTORY_MIN_SIZE)
        return false;

    const WebCore::TextEncoding& e = WebCore::UTF8Encoding();
    const char* data = *pData;
    const char* end = data + length;
    int sizeofUnsigned = (int)sizeof(unsigned);

    // Read the original url
    // Read the expected length of the string.
    int l;
    memcpy(&l, data, sizeofUnsigned);
    // Increment data pointer by the size of an unsigned int.
    data += sizeofUnsigned;
    if (l) {
        LOGV("Original url    %d %.*s", l, l, data);
        // If we have a length, check if that length exceeds the data length
        // and return null if there is not enough data.
        if (data + l < end)
            newItem->setOriginalURLString(e.decode(data, l));
        else
            return false;
        // Increment the data pointer by the length of the string.
        data += l;
    }
    // Check if we have enough data left to continue.
    if (end - data < sizeofUnsigned)
        return false;

    // Read the url
    memcpy(&l, data, sizeofUnsigned);
    data += sizeofUnsigned;
    if (l) {
        LOGV("Url             %d %.*s", l, l, data);
        if (data + l < end)
            newItem->setURLString(e.decode(data, l));
        else
            return false;
        data += l;
    }
    if (end - data < sizeofUnsigned)
        return false;

    // Read the title
    memcpy(&l, data, sizeofUnsigned);
    data += sizeofUnsigned;
    if (l) {
        LOGV("Title           %d %.*s", l, l, data);
        if (data + l < end)
            newItem->setTitle(e.decode(data, l));
        else
            return false;
        data += l;
    }
    if (end - data < sizeofUnsigned)
        return false;

    // Generate a new ResourceRequest object for populating form information.
    WebCore::String formContentType;
    WTF::PassRefPtr<WebCore::FormData> formData = NULL;

    // Read the form content type
    memcpy(&l, data, sizeofUnsigned);
    data += sizeofUnsigned;
    if (l) {
        LOGV("Content type    %d %.*s", l, l, data);
        if (data + l < end)
            formContentType = e.decode(data, l);
        else
            return false;
        data += l;
    }
    if (end - data < sizeofUnsigned)
        return false;

    // Read the form data
    memcpy(&l, data, sizeofUnsigned);
    data += sizeofUnsigned;
    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;
//.........这里部分代码省略.........
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:101,代码来源:WebHistory.cpp

示例14:

WebDragData::WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>& data)
    : m_private(static_cast<WebDragDataPrivate*>(data.releaseRef()))
{
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:4,代码来源:WebDragData.cpp

示例15: 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
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:27,代码来源:SamplerApollo.cpp


注:本文中的wtf::PassRefPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。