Changeset 144949 in webkit


Ignore:
Timestamp:
Mar 6, 2013 10:55:52 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Introduce new message sources for logging.
https://bugs.webkit.org/show_bug.cgi?id=110968

Patch by Dmitry Zvorygin <zvorygin@chromium.org> on 2013-03-06
Reviewed by Pavel Feldman.

Source/WebCore:

Added SecurityMessageSource, RenderingMessageSource, StorageMessageSource, AppCacheMessageSource, CSSMessageSource.
Changed some logging lines to contain more descriptive message source.

  • Modules/webdatabase/DatabaseBase.cpp:

(WebCore::DatabaseBase::logErrorMessage):

  • Modules/webdatabase/DatabaseManager.cpp:

(WebCore::DatabaseManager::logErrorMessage):

  • Modules/websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::fail):

  • bindings/ScriptControllerBase.cpp:

(WebCore::ScriptController::canExecuteScripts):

  • css/MediaList.cpp:

(WebCore::addResolutionWarningMessageToConsole):

  • dom/Document.cpp:

(WebCore::Document::processHttpEquiv):

  • dom/ScriptElement.cpp:

(WebCore::ScriptElement::executeScript):
(WebCore::ScriptElement::notifyFinished):

  • dom/ViewportArguments.cpp:

(WebCore::reportViewportWarning):

  • html/HTMLFormControlElement.cpp:

(WebCore::shouldAutofocus):

  • html/HTMLFormElement.cpp:

(WebCore::HTMLFormElement::validateInteractively):

  • html/HTMLIFrameElement.cpp:

(WebCore::HTMLIFrameElement::parseAttribute):

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::getImageData):

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore):
(WebCore::WebGLRenderingContext::printWarningToConsole):

  • html/parser/XSSAuditor.cpp:

(WebCore::XSSAuditor::init):

  • html/parser/XSSAuditorDelegate.cpp:

(WebCore::XSSAuditorDelegate::didBlockScript):

  • inspector/ConsoleMessage.cpp:

(WebCore::messageSourceValue):

  • inspector/Inspector.json:
  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::reportLocalLoadFailed):
(WebCore::createWindow):

  • loader/ImageLoader.cpp:

(WebCore::ImageLoader::notifyFinished):

  • loader/MainResourceLoader.cpp:

(WebCore::MainResourceLoader::responseReceived):

  • loader/MixedContentChecker.cpp:

(WebCore::MixedContentChecker::logWarning):

  • loader/TextTrackLoader.cpp:

(WebCore::TextTrackLoader::corsPolicyPreventedLoad):

  • loader/appcache/ApplicationCacheGroup.cpp:

(WebCore::ApplicationCacheGroup::abort):

  • loader/cache/CachedResourceLoader.cpp:

(WebCore::CachedResourceLoader::printAccessDeniedMessage):

  • page/Console.cpp:

(WebCore::printMessageSourceAndLevelPrefix):

  • page/ConsoleTypes.h:
  • page/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::logToConsole):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):

  • page/PointerLockController.cpp:

(WebCore::PointerLockController::requestPointerLock):

  • svg/SVGDocumentExtensions.cpp:

(WebCore::reportMessage):

Source/WebKit/mac:

  • WebCoreSupport/WebChromeClient.mm:
  • WebView/WebUIDelegatePrivate.h:
Location:
trunk/Source
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r144948 r144949  
     12013-03-06  Dmitry Zvorygin  <zvorygin@chromium.org>
     2
     3        Introduce new message sources for logging.
     4        https://bugs.webkit.org/show_bug.cgi?id=110968
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Added SecurityMessageSource, RenderingMessageSource, StorageMessageSource, AppCacheMessageSource, CSSMessageSource.
     9        Changed some logging lines to contain more descriptive message source.
     10
     11        * Modules/webdatabase/DatabaseBase.cpp:
     12        (WebCore::DatabaseBase::logErrorMessage):
     13        * Modules/webdatabase/DatabaseManager.cpp:
     14        (WebCore::DatabaseManager::logErrorMessage):
     15        * Modules/websockets/WebSocketChannel.cpp:
     16        (WebCore::WebSocketChannel::fail):
     17        * bindings/ScriptControllerBase.cpp:
     18        (WebCore::ScriptController::canExecuteScripts):
     19        * css/MediaList.cpp:
     20        (WebCore::addResolutionWarningMessageToConsole):
     21        * dom/Document.cpp:
     22        (WebCore::Document::processHttpEquiv):
     23        * dom/ScriptElement.cpp:
     24        (WebCore::ScriptElement::executeScript):
     25        (WebCore::ScriptElement::notifyFinished):
     26        * dom/ViewportArguments.cpp:
     27        (WebCore::reportViewportWarning):
     28        * html/HTMLFormControlElement.cpp:
     29        (WebCore::shouldAutofocus):
     30        * html/HTMLFormElement.cpp:
     31        (WebCore::HTMLFormElement::validateInteractively):
     32        * html/HTMLIFrameElement.cpp:
     33        (WebCore::HTMLIFrameElement::parseAttribute):
     34        * html/canvas/CanvasRenderingContext2D.cpp:
     35        (WebCore::CanvasRenderingContext2D::getImageData):
     36        * html/canvas/WebGLRenderingContext.cpp:
     37        (WebCore):
     38        (WebCore::WebGLRenderingContext::printWarningToConsole):
     39        * html/parser/XSSAuditor.cpp:
     40        (WebCore::XSSAuditor::init):
     41        * html/parser/XSSAuditorDelegate.cpp:
     42        (WebCore::XSSAuditorDelegate::didBlockScript):
     43        * inspector/ConsoleMessage.cpp:
     44        (WebCore::messageSourceValue):
     45        * inspector/Inspector.json:
     46        * loader/FrameLoader.cpp:
     47        (WebCore::FrameLoader::submitForm):
     48        (WebCore::FrameLoader::reportLocalLoadFailed):
     49        (WebCore::createWindow):
     50        * loader/ImageLoader.cpp:
     51        (WebCore::ImageLoader::notifyFinished):
     52        * loader/MainResourceLoader.cpp:
     53        (WebCore::MainResourceLoader::responseReceived):
     54        * loader/MixedContentChecker.cpp:
     55        (WebCore::MixedContentChecker::logWarning):
     56        * loader/TextTrackLoader.cpp:
     57        (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
     58        * loader/appcache/ApplicationCacheGroup.cpp:
     59        (WebCore::ApplicationCacheGroup::abort):
     60        * loader/cache/CachedResourceLoader.cpp:
     61        (WebCore::CachedResourceLoader::printAccessDeniedMessage):
     62        * page/Console.cpp:
     63        (WebCore::printMessageSourceAndLevelPrefix):
     64        * page/ConsoleTypes.h:
     65        * page/ContentSecurityPolicy.cpp:
     66        (WebCore::ContentSecurityPolicy::logToConsole):
     67        * page/DOMWindow.cpp:
     68        (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
     69        * page/PointerLockController.cpp:
     70        (WebCore::PointerLockController::requestPointerLock):
     71        * svg/SVGDocumentExtensions.cpp:
     72        (WebCore::reportMessage):
     73
    1742013-03-06  Florin Malita  <fmalita@chromium.org>
    275
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseBase.cpp

    r141928 r144949  
    4747void DatabaseBase::logErrorMessage(const String& message)
    4848{
    49     m_scriptExecutionContext->addConsoleMessage(OtherMessageSource, ErrorMessageLevel, message);
     49    m_scriptExecutionContext->addConsoleMessage(StorageMessageSource, ErrorMessageLevel, message);
    5050}
    5151
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp

    r144006 r144949  
    431431void DatabaseManager::logErrorMessage(ScriptExecutionContext* context, const String& message)
    432432{
    433     context->addConsoleMessage(OtherMessageSource, ErrorMessageLevel, message);
     433    context->addConsoleMessage(StorageMessageSource, ErrorMessageLevel, message);
    434434}
    435435
  • trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp

    r144607 r144949  
    196196    if (m_document) {
    197197        InspectorInstrumentation::didReceiveWebSocketFrameError(m_document, m_identifier, reason);
    198         m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "WebSocket connection to '" + m_handshake->url().elidedString() + "' failed: " + reason);
     198        m_document->addConsoleMessage(NetworkMessageSource, ErrorMessageLevel, "WebSocket connection to '" + m_handshake->url().elidedString() + "' failed: " + reason);
    199199    }
    200200
  • trunk/Source/WebCore/bindings/ScriptControllerBase.cpp

    r144607 r144949  
    4343        // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
    4444        if (reason == AboutToExecuteScript)
    45             m_frame->document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, "Blocked script execution in '" + m_frame->document()->url().elidedString() + "' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.");
     45            m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked script execution in '" + m_frame->document()->url().elidedString() + "' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.");
    4646        return false;
    4747    }
  • trunk/Source/WebCore/css/MediaList.cpp

    r144064 r144949  
    327327    message.append(serializedExpression);
    328328
    329     document->addConsoleMessage(HTMLMessageSource, DebugMessageLevel, message);
     329    document->addConsoleMessage(CSSMessageSource, DebugMessageLevel, message);
    330330}
    331331
  • trunk/Source/WebCore/dom/Document.cpp

    r144741 r144949  
    28752875                frameLoader->stopAllLoaders();
    28762876                frame->navigationScheduler()->scheduleLocationChange(securityOrigin(), blankURL(), String());
    2877                 addConsoleMessage(JSMessageSource, ErrorMessageLevel, message, requestIdentifier);
     2877                addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, requestIdentifier);
    28782878            }
    28792879        }
  • trunk/Source/WebCore/dom/ScriptElement.cpp

    r144607 r144949  
    297297#if ENABLE(NOSNIFF)
    298298    if (m_isExternalScript && m_cachedScript && !m_cachedScript->mimeTypeAllowedByNosniff()) {
    299         m_element->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Refused to execute script from '" + m_cachedScript->url().elidedString() + "' because its MIME type ('" + m_cachedScript->mimeType() + "') is not executable, and strict MIME type checking is enabled.");
     299        m_element->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + m_cachedScript->url().elidedString() + "' because its MIME type ('" + m_cachedScript->mimeType() + "') is not executable, and strict MIME type checking is enabled.");
    300300        return;
    301301    }
  • trunk/Source/WebCore/dom/ViewportArguments.cpp

    r139275 r144949  
    450450
    451451    // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
    452     document->addConsoleMessage(HTMLMessageSource, viewportErrorMessageLevel(errorCode), message);
     452    document->addConsoleMessage(RenderingMessageSource, viewportErrorMessageLevel(errorCode), message);
    453453}
    454454
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r143089 r144949  
    181181    if (element->document()->isSandboxed(SandboxAutomaticFeatures)) {
    182182        // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
    183         element->document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, "Blocked autofocusing on a form control because the form's frame is sandboxed and the 'allow-scripts' permission is not set.");
     183        element->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked autofocusing on a form control because the form's frame is sandboxed and the 'allow-scripts' permission is not set.");
    184184        return false;
    185185    }
  • trunk/Source/WebCore/html/HTMLFormElement.cpp

    r141816 r144949  
    262262            String message("An invalid form control with name='%name' is not focusable.");
    263263            message.replace("%name", unhandledAssociatedElement->name());
    264             document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, message);
     264            document()->addConsoleMessage(RenderingMessageSource, ErrorMessageLevel, message);
    265265        }
    266266    }
  • trunk/Source/WebCore/html/HTMLIFrameElement.cpp

    r143843 r144949  
    9191        setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(value, invalidTokens));
    9292        if (!invalidTokens.isNull())
    93             document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens);
     93            document()->addConsoleMessage(OtherMessageSource, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens);
    9494    } else if (name == seamlessAttr) {
    9595        // If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver.
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r143885 r144949  
    18681868    if (!canvas()->originClean()) {
    18691869        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Unable to get image data from canvas because the canvas has been tainted by cross-origin data.")));
    1870         canvas()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
     1870        canvas()->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, consoleMessage);
    18711871        ec = SECURITY_ERR;
    18721872        return 0;
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r144728 r144949  
    54845484    if (!document)
    54855485        return;
    5486     document->addConsoleMessage(HTMLMessageSource, WarningMessageLevel, message);
     5486    document->addConsoleMessage(RenderingMessageSource, WarningMessageLevel, message);
    54875487}
    54885488
  • trunk/Source/WebCore/html/parser/XSSAuditor.cpp

    r144683 r144949  
    290290        }
    291291        if (xssProtectionHeader == ContentSecurityPolicy::ReflectedXSSInvalid)
    292             document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Error parsing header X-XSS-Protection: " + headerValue + ": "  + errorDetails + " at character position " + String::format("%u", errorPosition) + ". The default protections will be applied.");
     292            document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Error parsing header X-XSS-Protection: " + headerValue + ": "  + errorDetails + " at character position " + String::format("%u", errorPosition) + ". The default protections will be applied.");
    293293
    294294        m_xssProtection = combineXSSProtectionHeaderAndCSP(xssProtectionHeader, document->contentSecurityPolicy()->reflectedXSSDisposition());
  • trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp

    r144568 r144949  
    6262    // FIXME: Consider using a more helpful console message.
    6363    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to execute a JavaScript script. Source code of script found within request.\n")));
    64     m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
     64    m_document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, consoleMessage);
    6565
    6666    if (xssInfo.m_didBlockEntirePage)
     
    8585
    8686    if (xssInfo.m_didBlockEntirePage) {
    87         m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, String("Entire page will be blocked."));
     87        m_document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, String("Entire page will be blocked."));
    8888        m_document->frame()->navigationScheduler()->scheduleLocationChange(m_document->securityOrigin(), String("data:text/html,<p></p>"), blankURL());
    8989    }
  • trunk/Source/WebCore/inspector/ConsoleMessage.cpp

    r144064 r144949  
    138138{
    139139    switch (source) {
    140     case HTMLMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Html;
    141140    case XMLMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Xml;
    142141    case JSMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Javascript;
    143142    case NetworkMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Network;
    144143    case ConsoleAPIMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Console_api;
     144    case StorageMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Storage;
     145    case AppCacheMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Appcache;
     146    case RenderingMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Rendering;
     147    case CSSMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Css;
     148    case SecurityMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Security;
    145149    case OtherMessageSource: return TypeBuilder::Console::ConsoleMessage::Source::Other;
    146150    }
  • trunk/Source/WebCore/inspector/Inspector.json

    r144824 r144949  
    769769                "description": "Console message.",
    770770                "properties": [
    771                     { "name": "source", "type": "string", "enum": ["html", "wml", "xml", "javascript", "network", "console-api", "other"], "description": "Message source." },
    772                     { "name": "level", "type": "string", "enum": ["tip", "log", "warning", "error", "debug"], "description": "Message severity." },
     771                    { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "other"], "description": "Message source." },
     772                    { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug"], "description": "Message severity." },
    773773                    { "name": "text", "type": "string", "description": "Message text." },
    774774                    { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing", "profile", "profileEnd"], "description": "Console message type." },
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r144805 r144949  
    341341    if (isDocumentSandboxed(m_frame, SandboxForms)) {
    342342        // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
    343         m_frame->document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, "Blocked form submission to '" + submission->action().elidedString() + "' because the form's frame is sandboxed and the 'allow-forms' permission is not set.");
     343        m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked form submission to '" + submission->action().elidedString() + "' because the form's frame is sandboxed and the 'allow-forms' permission is not set.");
    344344        return;
    345345    }
     
    14151415        return;
    14161416
    1417     frame->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Not allowed to load local resource: " + url);
     1417    frame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Not allowed to load local resource: " + url);
    14181418}
    14191419
     
    33683368    if (isDocumentSandboxed(openerFrame, SandboxPopups)) {
    33693369        // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
    3370         openerFrame->document()->addConsoleMessage(HTMLMessageSource, ErrorMessageLevel, "Blocked opening '" + request.resourceRequest().url().elidedString() + "' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.");
     3370        openerFrame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked opening '" + request.resourceRequest().url().elidedString() + "' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.");
    33713371        return 0;
    33723372    }
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r144825 r144949  
    296296
    297297        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin image load denied by Cross-Origin Resource Sharing policy.")));
    298         m_element->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
     298        m_element->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, consoleMessage);
    299299
    300300        ASSERT(!m_hasPendingLoadEvent);
  • trunk/Source/WebCore/loader/MainResourceLoader.cpp

    r144607 r144949  
    412412            InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_documentLoader->frame(), documentLoader(), identifier(), r);
    413413            String message = "Refused to display '" + r.url().elidedString() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";
    414             m_documentLoader->frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, message, identifier());
     414            m_documentLoader->frame()->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, identifier());
    415415
    416416            cancel();
  • trunk/Source/WebCore/loader/MixedContentChecker.cpp

    r144607 r144949  
    9797{
    9898    String message = makeString((allowed ? "" : "[blocked] "), "The page at ", m_frame->document()->url().elidedString(), " ", action, " insecure content from ", target.elidedString(), ".\n");
    99     m_frame->document()->addConsoleMessage(HTMLMessageSource, WarningMessageLevel, message);
     99    m_frame->document()->addConsoleMessage(SecurityMessageSource, WarningMessageLevel, message);
    100100}
    101101
  • trunk/Source/WebCore/loader/TextTrackLoader.cpp

    r144565 r144949  
    119119    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin text track load denied by Cross-Origin Resource Sharing policy.")));
    120120    Document* document = static_cast<Document*>(m_scriptExecutionContext);
    121     document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
     121    document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, consoleMessage);
    122122    m_state = Failed;
    123123}
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp

    r144607 r144949  
    476476        return;
    477477
    478     frame->document()->addConsoleMessage(OtherMessageSource, DebugMessageLevel, "Application Cache download process was aborted.");
     478    frame->document()->addConsoleMessage(NetworkMessageSource, DebugMessageLevel, "Application Cache download process was aborted.");
    479479    cacheUpdateFailed();
    480480}
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r144607 r144949  
    663663        message = "Unsafe attempt to load URL " + url.elidedString() + " from frame with URL " + m_document->url().elidedString() + ". Domains, protocols and ports must match.\n";
    664664
    665     frame()->document()->addConsoleMessage(OtherMessageSource, ErrorMessageLevel, message);
     665    frame()->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message);
    666666}
    667667
  • trunk/Source/WebCore/page/Console.cpp

    r144064 r144949  
    8989    const char* sourceString;
    9090    switch (source) {
    91     case HTMLMessageSource:
    92         sourceString = "HTML";
    93         break;
    9491    case XMLMessageSource:
    9592        sourceString = "XML";
     
    103100    case ConsoleAPIMessageSource:
    104101        sourceString = "CONSOLEAPI";
     102        break;
     103    case StorageMessageSource:
     104        sourceString = "STORAGE";
     105        break;
     106    case AppCacheMessageSource:
     107        sourceString = "APPCACHE";
     108        break;
     109    case RenderingMessageSource:
     110        sourceString = "RENDERING";
     111        break;
     112    case CSSMessageSource:
     113        sourceString = "CSS";
     114        break;
     115    case SecurityMessageSource:
     116        sourceString = "SECURITY";
    105117        break;
    106118    case OtherMessageSource:
  • trunk/Source/WebCore/page/ConsoleTypes.h

    r144064 r144949  
    3030
    3131enum MessageSource {
    32     HTMLMessageSource,
    3332    XMLMessageSource,
    3433    JSMessageSource,
    3534    NetworkMessageSource,
    3635    ConsoleAPIMessageSource,
     36    StorageMessageSource,
     37    AppCacheMessageSource,
     38    RenderingMessageSource,
     39    CSSMessageSource,
     40    SecurityMessageSource,
    3741    OtherMessageSource,
    3842};
  • trunk/Source/WebCore/page/ContentSecurityPolicy.cpp

    r144607 r144949  
    18161816void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, ScriptState* state) const
    18171817{
    1818     m_scriptExecutionContext->addConsoleMessage(JSMessageSource, ErrorMessageLevel, message, contextURL, contextLine.oneBasedInt(), state);
     1818    m_scriptExecutionContext->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, contextURL, contextLine.oneBasedInt(), state);
    18191819}
    18201820
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r144360 r144949  
    885885            String message = "Unable to post message to " + intendedTargetOrigin->toString() +
    886886                             ". Recipient has origin " + document()->securityOrigin()->toString() + ".\n";
    887             console()->addMessage(JSMessageSource, ErrorMessageLevel, message, stackTrace);
     887            console()->addMessage(SecurityMessageSource, ErrorMessageLevel, message, stackTrace);
    888888            return;
    889889        }
  • trunk/Source/WebCore/page/PointerLockController.cpp

    r144568 r144949  
    5757    if (target->document()->isSandboxed(SandboxPointerLock)) {
    5858        // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
    59         target->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.");
     59        target->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.");
    6060        enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
    6161        return;
  • trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp

    r138823 r144949  
    136136{
    137137    if (document->frame())
    138         document->addConsoleMessage(JSMessageSource, level, message);
     138        document->addConsoleMessage(RenderingMessageSource, level, message);
    139139}
    140140
  • trunk/Source/WebKit/mac/ChangeLog

    r144911 r144949  
     12013-03-06  Dmitry Zvorygin  <zvorygin@chromium.org>
     2
     3        Introduce new message sources for logging.
     4        https://bugs.webkit.org/show_bug.cgi?id=110968
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * WebCoreSupport/WebChromeClient.mm:
     9        * WebView/WebUIDelegatePrivate.h:
     10
    1112013-03-05  Kent Tamura  <tkent@chromium.org>
    212
  • trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r144795 r144949  
    9191#endif
    9292
    93 NSString *WebConsoleMessageHTMLMessageSource = @"HTMLMessageSource";
    9493NSString *WebConsoleMessageXMLMessageSource = @"XMLMessageSource";
    9594NSString *WebConsoleMessageJSMessageSource = @"JSMessageSource";
    9695NSString *WebConsoleMessageNetworkMessageSource = @"NetworkMessageSource";
    9796NSString *WebConsoleMessageConsoleAPIMessageSource = @"ConsoleAPIMessageSource";
     97NSString *WebConsoleMessageStorageMessageSource = @"StorageMessageSource";
     98NSString *WebConsoleMessageAppCacheMessageSource = @"AppCacheMessageSource";
     99NSString *WebConsoleMessageRenderingMessageSource = @"RenderingMessageSource";
     100NSString *WebConsoleMessageCSSMessageSource = @"CSSMessageSource";
     101NSString *WebConsoleMessageSecurityMessageSource = @"SecurityMessageSource";
    98102NSString *WebConsoleMessageOtherMessageSource = @"OtherMessageSource";
    99103
     
    330334{
    331335    switch (source) {
    332     case HTMLMessageSource:
    333         return WebConsoleMessageHTMLMessageSource;
    334336    case XMLMessageSource:
    335337        return WebConsoleMessageXMLMessageSource;
     
    340342    case ConsoleAPIMessageSource:
    341343        return WebConsoleMessageConsoleAPIMessageSource;
     344    case StorageMessageSource:
     345        return WebConsoleMessageStorageMessageSource;
     346    case AppCacheMessageSource:
     347        return WebConsoleMessageAppCacheMessageSource;
     348    case RenderingMessageSource:
     349        return WebConsoleMessageRenderingMessageSource;
     350    case CSSMessageSource:
     351        return WebConsoleMessageCSSMessageSource;
     352    case SecurityMessageSource:
     353        return WebConsoleMessageSecurityMessageSource;
    342354    case OtherMessageSource:
    343355        return WebConsoleMessageOtherMessageSource;
  • trunk/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r144064 r144949  
    105105
    106106// Message Sources.
    107 extern NSString *WebConsoleMessageHTMLMessageSource;
    108107extern NSString *WebConsoleMessageXMLMessageSource;
    109108extern NSString *WebConsoleMessageJSMessageSource;
    110109extern NSString *WebConsoleMessageNetworkMessageSource;
    111110extern NSString *WebConsoleMessageConsoleAPIMessageSource;
     111extern NSString *WebConsoleMessageStorageMessageSource;
     112extern NSString *WebConsoleMessageAppCacheMessageSource;
     113extern NSString *WebConsoleMessageRenderingMessageSource;
     114extern NSString *WebConsoleMessageCSSMessageSource;
     115extern NSString *WebConsoleMessageSecurityMessageSource;
    112116extern NSString *WebConsoleMessageOtherMessageSource;
    113117
     
    144148    @param webView The WebView sending the delegate method.
    145149    @param message A dictionary representation of the console message.
    146     @param source Where the message came from. See WebConsoleMessageHTMLMessageSource and other source types.
     150    @param source Where the message came from. See WebConsoleMessageXMLMessageSource and other source types.
    147151    @discussion The dictionary contains the following keys:
    148152
     
    156160        <dt>MessageSource</dt>
    157161        <dd>
    158             Where the message came from. HTML, XML, JavaScript, CSS, etc.
    159             See WebConsoleMessageHTMLMessageSource and similar constants.
     162            Where the message came from. XML, JavaScript, CSS, etc.
     163            See WebConsoleMessageXMLMessageSource and similar constants.
    160164        </dd>
    161165        <dt>MessageLevel</dt>
Note: See TracChangeset for help on using the changeset viewer.