ScriptValue PerformanceTiming::toJSONForBinding(
    ScriptState* scriptState) const {
  V8ObjectBuilder result(scriptState);
  result.addNumber("navigationStart", navigationStart());
  result.addNumber("unloadEventStart", unloadEventStart());
  result.addNumber("unloadEventEnd", unloadEventEnd());
  result.addNumber("redirectStart", redirectStart());
  result.addNumber("redirectEnd", redirectEnd());
  result.addNumber("fetchStart", fetchStart());
  result.addNumber("domainLookupStart", domainLookupStart());
  result.addNumber("domainLookupEnd", domainLookupEnd());
  result.addNumber("connectStart", connectStart());
  result.addNumber("connectEnd", connectEnd());
  result.addNumber("secureConnectionStart", secureConnectionStart());
  result.addNumber("requestStart", requestStart());
  result.addNumber("responseStart", responseStart());
  result.addNumber("responseEnd", responseEnd());
  result.addNumber("domLoading", domLoading());
  result.addNumber("domInteractive", domInteractive());
  result.addNumber("domContentLoadedEventStart", domContentLoadedEventStart());
  result.addNumber("domContentLoadedEventEnd", domContentLoadedEventEnd());
  result.addNumber("domComplete", domComplete());
  result.addNumber("loadEventStart", loadEventStart());
  result.addNumber("loadEventEnd", loadEventEnd());
  return result.scriptValue();
}
Exemple #2
0
void MyWebView::initEvents()
{
    // 委托页面所有连接在当前视图中打开
    myPage->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    connect(myPage, SIGNAL(linkClicked(QUrl)), this, SLOT(onOpenUrl(QUrl)));

    // 对所有事件添加信号槽
    connect(myFrame, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));
    connect(myFrame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(onJavaScriptWindowObjectCleared()));
    connect(myFrame, SIGNAL(initialLayoutCompleted()), this, SLOT(onInitialLayoutCompleted()));
    connect(myFrame, SIGNAL(pageChanged()), this, SLOT(onPageChanged()));
    connect(myFrame, SIGNAL(contentsSizeChanged(const QSize)), this, SLOT(onContentsSizeChanged(const QSize)));
    connect(myFrame, SIGNAL(iconChanged()), this, SLOT(onIconChanged()));
    connect(myFrame, SIGNAL(loadStarted()), this, SLOT(onLoadStarted()));
    connect(myFrame, SIGNAL(titleChanged(const QString)), this, SLOT(onTitleChanged(const QString)));
    connect(myFrame, SIGNAL(urlChanged(const QUrl)), this, SLOT(onUrlChanged(const QUrl)));

    connect(myPage, SIGNAL(loadProgress(int)), this, SLOT(onLoadProgress(int)));
    connect(myPage, SIGNAL(repaintRequested(const QRect)), this, SLOT(onRepaintRequested(const QRect)));
    connect(myPage, SIGNAL(geometryChangeRequested(const QRect)), this, SLOT(onGeometryChangeRequested(const QRect)));

    connect(newManager, SIGNAL(requestFinished(QString)),
            this, SLOT(onRequestFinished(QString)));
    connect(newManager, SIGNAL(requestStart(QString)),
            this, SLOT(onRequestStart(QString)));
};
QNetworkReply* NetworkAccessManager::createRequest(QNetworkAccessManager::Operation operation,
    const QNetworkRequest &request, QIODevice *device)
{

    qint64 time;
    if (isListener) {
        time = QDateTime::currentDateTime().toMSecsSinceEpoch();
    }

    QNetworkReply *reply = QNetworkAccessManager::createRequest(operation, request, device);
    reply->ignoreSslErrors();
    if (isListener) {
       // 触发请求开始的自定义信号
       emit requestStart(request.url().toString());

       // 不清除这个指针
       // TODO: 该类由 webview 接管处理
       CustomDownload* customDownload = new CustomDownload(reply, request,
                           QDateTime::currentDateTime().toMSecsSinceEpoch() - time,
                           time);

       connect(customDownload, SIGNAL(requestFinished(QString)),
               this, SLOT(onRequestFinished(QString)));
    }

    return reply;
}
double PerformanceResourceTiming::responseStart() const
{
    if (!m_shouldReportDetails)
        return 0.0;

    if (!m_timing)
        return requestStart();
    // FIXME: This number isn't exactly correct. See the notes in PerformanceTiming::responseStart().
    return resourceTimeToDocumentMilliseconds(m_timing->receiveHeadersEnd);
}
unsigned long long PerformanceTiming::responseStart() const
{
    DocumentLoader* loader = documentLoader();
    if (!loader)
        return requestStart();

    const ResourceLoadTiming& timing = loader->response().resourceLoadTiming();
    
    ASSERT(timing.responseStart >= 0);
    return resourceLoadTimeRelativeToAbsolute(timing.responseStart);
}
double PerformanceResourceTiming::responseStart() const
{
    if (!m_allowTimingDetails)
        return 0.0;

    if (!m_timing)
        return requestStart();

    // FIXME: This number isn't exactly correct. See the notes in PerformanceTiming::responseStart().
    return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, m_timing->receiveHeadersEnd());
}
unsigned long long PerformanceTiming::responseStart() const {
  ResourceLoadTiming* timing = resourceLoadTiming();
  if (!timing || timing->receiveHeadersEnd() == 0.0)
    return requestStart();

  // FIXME: Response start needs to be the time of the first received byte.
  // However, the ResourceLoadTiming API currently only supports the time
  // the last header byte was received. For many responses with reasonable
  // sized cookies, the HTTP headers fit into a single packet so this time
  // is basically equivalent. But for some responses, particularly those with
  // headers larger than a single packet, this time will be too late.
  return monotonicTimeToIntegerMilliseconds(timing->receiveHeadersEnd());
}
void PerformanceResourceTiming::buildJSONValue(V8ObjectBuilder& builder) const
{
    PerformanceEntry::buildJSONValue(builder);
    builder.addString("initiatorType", initiatorType());
    builder.addNumber("workerStart", workerStart());
    builder.addNumber("redirectStart", redirectStart());
    builder.addNumber("redirectEnd", redirectEnd());
    builder.addNumber("fetchStart", fetchStart());
    builder.addNumber("domainLookupStart", domainLookupStart());
    builder.addNumber("domainLookupEnd", domainLookupEnd());
    builder.addNumber("connectStart", connectStart());
    builder.addNumber("connectEnd", connectEnd());
    builder.addNumber("secureConnectionStart", secureConnectionStart());
    builder.addNumber("requestStart", requestStart());
    builder.addNumber("responseStart", responseStart());
    builder.addNumber("responseEnd", responseEnd());
}
// ----------------------------------------------------------------------------
void ConnectToServer::update(int ticks)
{
    switch(m_state.load())
    {
        case GOT_SERVER_ADDRESS:
        {
            // Make sure lobby display the quick play server name
            assert(m_server);
            NetworkingLobby::getInstance()->setJoinedServer(m_server);
            break;
        }
        case DONE:
        {
            // lobby room protocol if we're connected only
            if (STKHost::get()->getPeerCount() > 0 &&
                STKHost::get()->getServerPeerForClient()->isConnected() &&
                !m_server_address.isUnset())
            {
                // Let main thread create ClientLobby for better
                // synchronization with GUI
                NetworkConfig::get()->clearActivePlayersForClient();
                auto cl = LobbyProtocol::create<ClientLobby>(m_server_address,
                    m_server);
                STKHost::get()->startListening();
                cl->requestStart();
            }
            if (STKHost::get()->getPeerCount() == 0)
            {
                // Shutdown STKHost (go back to online menu too)
                STKHost::get()->setErrorMessage(
                    _("Cannot connect to server %s.", m_server->getName()));
                STKHost::get()->requestShutdown();
            }
            requestTerminate();
            m_state = EXITING;
            break;
        }
        default:
            break;
    }
}   // update
Exemple #10
0
void SLURMProcess::start()
{
    LOG(Debug, "Requesting job start");
    m_starting = true;
    emit requestStart(m_procid);
}
	c22->attach(s22);




}

void MainWindow::setupSignalsAndSlots()
{
	connect(ui->doInitialize, SIGNAL(clicked(bool)), this, SLOT(onInitializeToggled(bool)));
	connect(ui->runToggle, SIGNAL(clicked(bool)), this, SLOT(onRunToggled(bool)));

	// MainWindow to VNALibrary
	connect(this, SIGNAL(requestLoadDLL(QString)), &lib, SLOT(loadAsync(QString)));
	connect(this, SIGNAL(requestInitialize(QtTaskHandle, Qtvoidptr)), &lib, SLOT(initializeAsync(QtTaskHandle, Qtvoidptr)));
	connect(this, SIGNAL(requestStart(QtTaskHandle)), &lib, SLOT(startAsync(QtTaskHandle)));
	connect(this, SIGNAL(requestStop(QtTaskHandle)), &lib, SLOT(stopAsync(QtTaskHandle)));
	connect(this, SIGNAL(requestUtilPingUnit(QtTaskHandle)), &lib, SLOT(utilPingUnitAsync(QtTaskHandle)));
	connect(this, SIGNAL(requestMeasureUncalibrated(QtTaskHandle,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData)),
			&lib, SLOT(measureUncalibratedAsync(QtTaskHandle, QtComplexData, QtComplexData, QtComplexData, QtComplexData, QtComplexData)));
	connect(this, SIGNAL(requestMeasure2PortCalibrated(QtTaskHandle,QtComplexData,QtComplexData,QtComplexData,QtComplexData)),
			&lib, SLOT(measure2PortCalibratedAsync(QtTaskHandle, QtComplexData, QtComplexData, QtComplexData, QtComplexData)));
	connect(this, SIGNAL(requestMeasureCalibrationStep(QtTaskHandle,QtCalibrationStep)),
			&lib, SLOT(measureCalibrationStepAsync(QtTaskHandle, QtCalibrationStep)));
	connect(this, SIGNAL(requestImportCalibrationAsync(QtTaskHandle,const double*,uint,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData)),
			&lib, SLOT(importCalibrationAsync(QtTaskHandle,const double*,uint,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData,QtComplexData)));
	connect(this, SIGNAL(requestClearCalibration(QtTaskHandle)), &lib, SLOT(clearCalibrationAsync(QtTaskHandle)));

	// VNALibrary to MainWindow
	connect(&lib, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));
	connect(&lib, SIGNAL(initializeProgress(int,Qtvoidptr)), this, SLOT(onInitializeProgress(int,Qtvoidptr)));