示例#1
0
void InspectorPageAgent::frameAttachedToParent(LocalFrame* frame)
{
    Frame* parentFrame = frame->tree().parent();
    if (!parentFrame->isLocalFrame())
        parentFrame = 0;
    m_frontend->frameAttached(frameId(frame), frameId(toLocalFrame(parentFrame)));
}
示例#2
0
static PassRefPtr<InspectorObject> buildObjectForFrame(Frame* frame)
{
    RefPtr<InspectorObject> frameObject = InspectorObject::create();
    frameObject->setNumber("id", frameId(frame));
    frameObject->setNumber("parentId", frameId(frame->tree()->parent()));
    if (frame->ownerElement()) {
        String name = frame->ownerElement()->getAttribute(HTMLNames::nameAttr);
        if (name.isEmpty())
            name = frame->ownerElement()->getAttribute(HTMLNames::idAttr);
        frameObject->setString("name", name);
    }
    frameObject->setString("url", frame->document()->url().string());
    return frameObject;
}
示例#3
0
static PassRefPtr<InspectorObject> buildObjectForDocumentLoader(DocumentLoader* loader)
{
    RefPtr<InspectorObject> documentLoaderObject = InspectorObject::create();
    documentLoaderObject->setNumber("frameId", frameId(loader->frame()));
    documentLoaderObject->setNumber("loaderId", reinterpret_cast<uintptr_t>(loader));
    documentLoaderObject->setString("url", loader->requestURL().string());
    return documentLoaderObject;
}
示例#4
0
PassRefPtr<InspectorObject> InspectorPageAgent::buildObjectForFrame(Frame* frame)
{
    RefPtr<InspectorObject> frameObject = InspectorObject::create();
    frameObject->setString("id", frameId(frame));
    if (frame->tree()->parent())
        frameObject->setString("parentId", frameId(frame->tree()->parent()));
    if (frame->ownerElement()) {
        String name = frame->ownerElement()->getAttribute(HTMLNames::nameAttr);
        if (name.isEmpty())
            name = frame->ownerElement()->getAttribute(HTMLNames::idAttr);
        frameObject->setString("name", name);
    }
    frameObject->setString("url", frame->document()->url().string());
    frameObject->setString("loaderId", loaderId(frame->loader()->documentLoader()));
    frameObject->setString("mimeType", frame->loader()->documentLoader()->responseMIMEType());

    return frameObject;
}
示例#5
0
void InspectorResourceAgent::resourceContent(unsigned long id, const String& url, bool base64Encode, String* content)
{
    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame())) {
        if (frameId(frame) != id)
            continue;
        if (base64Encode)
            InspectorResourceAgent::resourceContentBase64(frame, KURL(ParsedURLString, url), content);
        else
            InspectorResourceAgent::resourceContent(frame, KURL(ParsedURLString, url), content);
        break;
    }
}
示例#6
0
PassRefPtr<TypeBuilder::Page::Frame> InspectorPageAgent::buildObjectForFrame(LocalFrame* frame)
{
    RefPtr<TypeBuilder::Page::Frame> frameObject = TypeBuilder::Page::Frame::create()
        .setId(frameId(frame))
        .setLoaderId(loaderId(frame->loader().documentLoader()))
        .setUrl(urlWithoutFragment(frame->document()->url()).string())
        .setMimeType(frame->loader().documentLoader()->responseMIMEType())
        .setSecurityOrigin(frame->document()->securityOrigin()->toRawString());
    // FIXME: This doesn't work for OOPI.
    Frame* parentFrame = frame->tree().parent();
    if (parentFrame && parentFrame->isLocalFrame())
        frameObject->setParentId(frameId(toLocalFrame(parentFrame)));
    if (frame->deprecatedLocalOwner()) {
        AtomicString name = frame->deprecatedLocalOwner()->getNameAttribute();
        if (name.isEmpty())
            name = frame->deprecatedLocalOwner()->getAttribute(HTMLNames::idAttr);
        frameObject->setName(name);
    }

    return frameObject;
}
示例#7
0
void PinholeRGBDevice::cameraInfoCallback(const sensor_msgs::CameraInfo::ConstPtr & camera_info_msg)
{
  last_messages_.camera_info_msg = camera_info_msg;
  if (not isSensorSet())
  {
    sensor_ = boost::make_shared<calibration::PinholeSensor>();
    calibration::PinholeCameraModel::ConstPtr cm = boost::make_shared<calibration::PinholeCameraModel>(*camera_info_msg);
    sensor_->setFrameId(frameId());
    sensor_->setCameraModel(cm);
  }
  setHasNewMessages(last_messages_.image_msg);
}
示例#8
0
void InspectorPageAgent::searchInResources(ErrorString*, const String& text, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>* object)
{
    RefPtr<InspectorArray> result = InspectorArray::create();

    bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
    String regexSource = isRegex ? text : createSearchRegexSource(text);

    bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
    RegularExpression regex(regexSource, caseSensitive ? TextCaseSensitive : TextCaseInsensitive);

    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame())) {
        String content;
        bool base64Encoded;
        Vector<CachedResource*> allResources = cachedResourcesForFrame(frame);
        for (Vector<CachedResource*>::const_iterator it = allResources.begin(); it != allResources.end(); ++it) {
            CachedResource* cachedResource = *it;
            switch (InspectorPageAgent::cachedResourceType(*cachedResource)) {
            case InspectorPageAgent::StylesheetResource:
            case InspectorPageAgent::ScriptResource:
                if (cachedResourceContent(cachedResource, &content, &base64Encoded)) {
                    ASSERT(!base64Encoded);
                    int matchesCount = countRegularExpressionMatches(regex, content);
                    if (matchesCount)
                        result->pushValue(buildObjectForSearchMatch(frameId(frame), cachedResource->url(), matchesCount));
                }
                break;
            default:
                break;
            }
        }
        if (mainResourceContent(frame, false, &content)) {
            int matchesCount = countRegularExpressionMatches(regex, content);
            if (matchesCount)
                result->pushValue(buildObjectForSearchMatch(frameId(frame), frame->document()->url(), matchesCount));
        }
    }

    *object = result;
}
示例#9
0
void SwissRangerDevice::imageCallback(const sensor_msgs::Image::ConstPtr & image_msg,
                                      const sensor_msgs::CameraInfo::ConstPtr & camera_info_msg)
{
  last_messages_.intensity_msg = image_msg;
  last_messages_.camera_info_msg = camera_info_msg;
  if (not isIntensitySensorSet())
  {
    intensity_sensor_ = boost::make_shared<calibration::PinholeSensor>();
    calibration::PinholeCameraModel::ConstPtr cm = boost::make_shared<calibration::PinholeCameraModel>(*camera_info_msg);
    intensity_sensor_->setFrameId(frameId());
    intensity_sensor_->setCameraModel(cm);
  }
  setHasNewMessages(last_messages_.cloud_msg);
}
void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, const ResourceRequest& request, Frame* frame)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> recordRaw = TimelineRecordFactory::createGenericRecord(timestamp(), m_maxCallStackDepth);
    String requestId = IdentifiersFactory::requestId(identifier);
    recordRaw->setObject("data", TimelineRecordFactory::createResourceSendRequestData(requestId, request));
    recordRaw->setString("type", TimelineRecordType::ResourceSendRequest);
    if (frame && m_pageAgent) {
        String frameId(m_pageAgent->frameId(frame));
        recordRaw->setString("frameId", frameId);
    }
    setHeapSizeStatistics(recordRaw.get());
    // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now.
    RefPtr<TypeBuilder::Timeline::TimelineEvent> record = TypeBuilder::Timeline::TimelineEvent::runtimeCast(recordRaw.release());
    m_frontend->eventRecorded(record.release());
}
示例#11
0
void InspectorResourceAgent::frameDetachedFromParent(Frame* frame)
{
    m_frontend->frameDetachedFromParent(frameId(frame));
}
示例#12
0
void InspectorPageAgent::frameStoppedLoading(LocalFrame* frame)
{
    m_frontend->frameStoppedLoading(frameId(frame));
}
示例#13
0
void InspectorPageAgent::frameClearedScheduledNavigation(LocalFrame* frame)
{
    m_frontend->frameClearedScheduledNavigation(frameId(frame));
}
示例#14
0
void InspectorPageAgent::frameScheduledNavigation(LocalFrame* frame, double delay)
{
    m_frontend->frameScheduledNavigation(frameId(frame), delay);
}
示例#15
0
int MainThreadDebugger::contextGroupId(LocalFrame* frame)
{
    LocalFrame* localFrameRoot = frame->localFrameRoot();
    return frameId(localFrameRoot);
}
示例#16
0
void InspectorPageAgent::frameDetached(Frame* frame)
{
    m_frontend->frameDetached(frameId(frame));
}