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


C++ LocalFrame::console方法代码示例

本文整理汇总了C++中LocalFrame::console方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalFrame::console方法的具体用法?C++ LocalFrame::console怎么用?C++ LocalFrame::console使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LocalFrame的用法示例。


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

示例1: didFailLoading

void PingLoader::didFailLoading(Page* page)
{
    LocalFrame* frame = page->deprecatedLocalMainFrame();
    InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError::cancelledError(m_url));
    // Notification to FrameConsole should come AFTER Resource Agent notification, front-end relies on this.
    frame->console().didFailLoading(m_identifier, ResourceError::cancelledError(m_url));
}
开发者ID:335969568,项目名称:Blink-1,代码行数:7,代码来源:PingLoader.cpp

示例2: messageAddedToConsole

void MainThreadDebugger::messageAddedToConsole(int contextGroupId, MessageSource source, MessageLevel level, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTrace* stackTrace)
{
    LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId);
    if (!frame)
        return;
    ConsoleMessage* consoleMessage = ConsoleMessage::create(source, level, message, SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0));
    frame->console().reportMessageToClient(consoleMessage);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:8,代码来源:MainThreadDebugger.cpp

示例3: terminateInternally

void WorkerMessagingProxy::terminateInternally()
{
    InspectorInstrumentation::workerGlobalScopeTerminated(m_executionContext.get(), this);

    // FIXME: This need to be revisited when we support nested worker one day
    ASSERT(m_executionContext->isDocument());
    Document* document = toDocument(m_executionContext.get());
    LocalFrame* frame = document->frame();
    if (frame)
        frame->console().adoptWorkerConsoleMessages(this);
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:11,代码来源:WorkerMessagingProxy.cpp

示例4: terminateInternally

void WorkerMessagingProxy::terminateInternally()
{
    m_workerInspectorProxy->workerThreadTerminated();

    // FIXME: This need to be revisited when we support nested worker one day
    ASSERT(m_executionContext->isDocument());
    Document* document = toDocument(m_executionContext.get());
    LocalFrame* frame = document->frame();
    if (frame)
        frame->console().adoptWorkerMessagesAfterTermination(this);
}
开发者ID:Pluto-tv,项目名称:blink-crosswalk,代码行数:11,代码来源:WorkerMessagingProxy.cpp

示例5: countDeprecation

void UseCounter::countDeprecation(const Document& document, Feature feature)
{
    FrameHost* host = document.frameHost();
    LocalFrame* frame = document.frame();
    if (!host || !frame)
        return;

    if (host->useCounter().recordMeasurement(feature)) {
        ASSERT(!host->useCounter().deprecationMessage(feature).isEmpty());
        frame->console().addMessage(DeprecationMessageSource, WarningMessageLevel, host->useCounter().deprecationMessage(feature));
    }
}
开发者ID:ericwilligers,项目名称:blink,代码行数:12,代码来源:UseCounter.cpp

示例6: messageStorage

ConsoleMessageStorage* FrameConsole::messageStorage()
{
    LocalFrame* curFrame = m_frame;
    Frame* topFrame = curFrame->tree().top();
    ASSERT(topFrame->isLocalFrame());
    LocalFrame* localTopFrame = toLocalFrame(topFrame);
    if (localTopFrame != curFrame)
        return localTopFrame->console().messageStorage();
    if (!m_consoleMessageStorage)
        m_consoleMessageStorage = ConsoleMessageStorage::createForFrame(m_frame);
    return m_consoleMessageStorage.get();
}
开发者ID:335969568,项目名称:Blink-1,代码行数:12,代码来源:FrameConsole.cpp

示例7: reportResponseReceived

void DocumentThreadableLoader::reportResponseReceived(unsigned long identifier, const ResourceResponse& response)
{
    LocalFrame* frame = document().frame();
    // We are seeing crashes caused by nullptr (crbug.com/578849). But the frame
    // must be set here. TODO(horo): Find the root cause of the unset frame.
    ASSERT(frame);
    if (!frame)
        return;
    DocumentLoader* loader = frame->loader().documentLoader();
    TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_EVENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame, response));
    InspectorInstrumentation::didReceiveResourceResponse(frame, identifier, loader, response, resource() ? resource()->loader() : 0);
    frame->console().reportResourceResponseReceived(loader, identifier, response);
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:13,代码来源:DocumentThreadableLoader.cpp

示例8: reportConsoleMessage

void WorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
{
    if (m_askedToTerminate)
        return;
    // FIXME: In case of nested workers, this should go directly to the root Document context.
    ASSERT(m_executionContext->isDocument());
    Document* document = toDocument(m_executionContext.get());
    LocalFrame* frame = document->frame();
    if (!frame)
        return;

    RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, level, message, sourceURL, lineNumber);
    consoleMessage->setWorkerId(this);
    frame->console().addMessage(consoleMessage.release());
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:15,代码来源:WorkerMessagingProxy.cpp

示例9: tryCatch

AtomicString V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix) {
  v8::Isolate* isolate = m_scriptState->isolate();
  v8::Local<v8::Function> lookupNamespaceURIFunc;
  v8::Local<v8::String> lookupNamespaceURIName =
      v8AtomicString(isolate, "lookupNamespaceURI");

  // Check if the resolver has a function property named lookupNamespaceURI.
  v8::Local<v8::Value> lookupNamespaceURI;
  if (m_resolver->Get(m_scriptState->context(), lookupNamespaceURIName)
          .ToLocal(&lookupNamespaceURI) &&
      lookupNamespaceURI->IsFunction())
    lookupNamespaceURIFunc = v8::Local<v8::Function>::Cast(lookupNamespaceURI);

  if (lookupNamespaceURIFunc.IsEmpty() && !m_resolver->IsFunction()) {
    LocalFrame* frame =
        toLocalDOMWindow(toDOMWindow(m_scriptState->context()))->frame();
    if (frame && frame->host())
      frame->console().addMessage(ConsoleMessage::create(
          JSMessageSource, ErrorMessageLevel,
          "XPathNSResolver does not have a lookupNamespaceURI method."));
    return nullAtom;
  }

  // Catch exceptions from calling the namespace resolver.
  v8::TryCatch tryCatch(isolate);
  tryCatch.SetVerbose(true);  // Print exceptions to console.

  const int argc = 1;
  v8::Local<v8::Value> argv[argc] = {v8String(isolate, prefix)};
  v8::Local<v8::Function> function =
      lookupNamespaceURIFunc.IsEmpty()
          ? v8::Local<v8::Function>::Cast(m_resolver)
          : lookupNamespaceURIFunc;

  v8::Local<v8::Value> retval;
  // Eat exceptions from namespace resolver and return an empty string. This
  // will most likely cause NamespaceError.
  if (!V8ScriptRunner::callFunction(
           function, toExecutionContext(m_scriptState->context()), m_resolver,
           argc, argv, isolate)
           .ToLocal(&retval))
    return nullAtom;

  TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, returnString,
                   retval, nullAtom);
  return returnString;
}
开发者ID:mirror,项目名称:chromium,代码行数:47,代码来源:V8CustomXPathNSResolver.cpp

示例10: docLoaderFunc

static xmlDocPtr docLoaderFunc(
    const xmlChar* uri, xmlDictPtr, int options, void* ctxt, xsltLoadType type)
{
    if (!globalProcessor)
        return 0;

    switch (type) {
    case XSLT_LOAD_DOCUMENT: {
        xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt;
        xmlChar* base = xmlNodeGetBase(context->document->doc, context->node);
        KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), reinterpret_cast<const char*>(uri));
        xmlFree(base);

        ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptions());
        FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, fetchOptions);
        request.setOriginRestriction(FetchRequest::RestrictToSameOrigin);
        ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronously(request);
        if (!resource || !globalProcessor)
            return 0;

        FrameConsole* console = 0;
        LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame();
        if (frame)
            console = &frame->console();
        xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
        xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);

        // We don't specify an encoding here. Neither Gecko nor WinIE respects
        // the encoding specified in the HTTP headers.
        SharedBuffer* data = resource->resourceBuffer();
        xmlDocPtr doc = data ? xmlReadMemory(data->data(), data->size(), (const char*)uri, 0, options) : 0;

        xmlSetStructuredErrorFunc(0, 0);
        xmlSetGenericErrorFunc(0, 0);

        return doc;
    }
    case XSLT_LOAD_STYLESHEET:
        return globalProcessor->xslStylesheet()->locateStylesheetSubResource(((xsltStylesheetPtr)ctxt)->doc, uri);
    default:
        break;
    }

    return 0;
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:45,代码来源:XSLTProcessorLibxslt.cpp

示例11: exceptionThrown

void MainThreadDebugger::exceptionThrown(ExecutionContext* context,
                                         ErrorEvent* event) {
  LocalFrame* frame = nullptr;
  ScriptState* scriptState = nullptr;
  if (context->isDocument()) {
    frame = toDocument(context)->frame();
    if (!frame)
      return;
    scriptState = event->world() ? ScriptState::forWorld(frame, *event->world())
                                 : nullptr;
  } else if (context->isMainThreadWorkletGlobalScope()) {
    frame = toMainThreadWorkletGlobalScope(context)->frame();
    if (!frame)
      return;
    scriptState = toMainThreadWorkletGlobalScope(context)
                      ->scriptController()
                      ->getScriptState();
  } else {
    NOTREACHED();
  }

  frame->console().reportMessageToClient(JSMessageSource, ErrorMessageLevel,
                                         event->messageForConsole(),
                                         event->location());

  const String defaultMessage = "Uncaught";
  if (scriptState && scriptState->contextIsValid()) {
    ScriptState::Scope scope(scriptState);
    v8::Local<v8::Value> exception =
        V8ErrorHandler::loadExceptionFromErrorEventWrapper(
            scriptState, event, scriptState->context()->Global());
    SourceLocation* location = event->location();
    String message = event->messageForConsole();
    String url = location->url();
    v8Inspector()->exceptionThrown(
        scriptState->context(), toV8InspectorStringView(defaultMessage),
        exception, toV8InspectorStringView(message),
        toV8InspectorStringView(url), location->lineNumber(),
        location->columnNumber(), location->takeStackTrace(),
        location->scriptId());
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:42,代码来源:MainThreadDebugger.cpp

示例12: consoleAPIMessage

void MainThreadDebugger::consoleAPIMessage(
    int contextGroupId,
    v8_inspector::V8ConsoleAPIType type,
    const v8_inspector::StringView& message,
    const v8_inspector::StringView& url,
    unsigned lineNumber,
    unsigned columnNumber,
    v8_inspector::V8StackTrace* stackTrace) {
  LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId);
  if (!frame)
    return;
  if (type == v8_inspector::V8ConsoleAPIType::kClear && frame->host())
    frame->host()->consoleMessageStorage().clear();
  // TODO(dgozman): we can save a copy of message and url here by making
  // FrameConsole work with StringView.
  std::unique_ptr<SourceLocation> location =
      SourceLocation::create(toCoreString(url), lineNumber, columnNumber,
                             stackTrace ? stackTrace->clone() : nullptr, 0);
  frame->console().reportMessageToClient(ConsoleAPIMessageSource,
                                         consoleAPITypeToMessageLevel(type),
                                         toCoreString(message), location.get());
}
开发者ID:mirror,项目名称:chromium,代码行数:22,代码来源:MainThreadDebugger.cpp


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