Changeset 102794 in webkit


Ignore:
Timestamp:
Dec 14, 2011 10:03:32 AM (12 years ago)
Author:
kbr@google.com
Message:

Unreviewed, rolling out r102688.
http://trac.webkit.org/changeset/102688
https://bugs.webkit.org/show_bug.cgi?id=74220

Under the hypothesis that it might be the cause of
browser_tests and ui_tests crashes on Chromium canaries --
will reland if not.

  • bindings/v8/V8Proxy.cpp:

(WebCore::addMessageToConsole):
(WebCore::logInfo):
(WebCore::V8Proxy::reportUnsafeAccessTo):

  • bindings/v8/V8Proxy.h:
  • bindings/v8/custom/V8CustomXPathNSResolver.cpp:

(WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102793 r102794  
     12011-12-14  Kenneth Russell  <kbr@google.com>
     2
     3        Unreviewed, rolling out r102688.
     4        http://trac.webkit.org/changeset/102688
     5        https://bugs.webkit.org/show_bug.cgi?id=74220
     6
     7        Under the hypothesis that it might be the cause of
     8        browser_tests and ui_tests crashes on Chromium canaries --
     9        will reland if not.
     10
     11        * bindings/v8/V8Proxy.cpp:
     12        (WebCore::addMessageToConsole):
     13        (WebCore::logInfo):
     14        (WebCore::V8Proxy::reportUnsafeAccessTo):
     15        * bindings/v8/V8Proxy.h:
     16        * bindings/v8/custom/V8CustomXPathNSResolver.cpp:
     17        (WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
     18
    1192011-12-14  Vsevolod Vlasov  <vsevik@chromium.org>
    220
  • trunk/Source/WebCore/bindings/v8/V8Proxy.cpp

    r102688 r102794  
    3434#include "CSSMutableStyleDeclaration.h"
    3535#include "CachedMetadata.h"
     36#include "Console.h"
    3637#include "DateExtension.h"
    3738#include "Document.h"
     
    4344#include "IDBFactoryBackendInterface.h"
    4445#include "InspectorInstrumentation.h"
     46#include "Page.h"
    4547#include "PlatformSupport.h"
    4648#include "ScriptSourceCode.h"
     
    118120typedef HashMap<int, v8::FunctionTemplate*> FunctionTemplateMap;
    119121
     122static void addMessageToConsole(Page* page, const String& message, const String& sourceID, unsigned lineNumber)
     123{
     124    ASSERT(page);
     125    Console* console = page->mainFrame()->domWindow()->console();
     126    console->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, lineNumber, sourceID);
     127}
     128
     129void logInfo(Frame* frame, const String& message, const String& url)
     130{
     131    Page* page = frame->page();
     132    if (!page)
     133        return;
     134    addMessageToConsole(page, message, url, 0);
     135}
     136
    120137void V8Proxy::reportUnsafeAccessTo(Frame* target)
    121138{
     
    128145    if (!source)
    129146        return;
     147    Page* page = source->page();
     148    if (!page)
     149        return;
    130150
    131151    Document* sourceDocument = source->document();
     
    138158                 " from frame with URL " + sourceDocument->url().string() + ". Domains, protocols and ports must match.\n";
    139159
     160    // Build a console message with fake source ID and line number.
     161    const String kSourceID = "";
     162    const int kLineNumber = 1;
     163
    140164    // NOTE: Safari prints the message in the target page, but it seems like
    141165    // it should be in the source page. Even for delayed messages, we put it in
    142166    // the source page.
    143     sourceDocument->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, str);
     167    addMessageToConsole(page, str, kSourceID, kLineNumber);
    144168}
    145169
  • trunk/Source/WebCore/bindings/v8/V8Proxy.h

    r102688 r102794  
    6666    class WorldContextHandle;
    6767
     68    // FIXME: use standard logging facilities in WebCore.
     69    void logInfo(Frame*, const String& message, const String& url);
     70
    6871    // The following Batch structs and methods are used for setting multiple
    6972    // properties on an ObjectTemplate, used from the generated bindings
  • trunk/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp

    r102688 r102794  
    3131#include "V8CustomXPathNSResolver.h"
    3232
    33 #include "ScriptCallStack.h"
    34 #include "ScriptExecutionContext.h"
     33#include "PlatformString.h"
    3534#include "V8Binding.h"
    3635#include "V8Proxy.h"
    37 #include "V8Utilities.h"
    38 #include <wtf/text/WTFString.h>
    3936
    4037namespace WebCore {
     
    6764
    6865    if (lookupNamespaceURIFunc.IsEmpty() && !m_resolver->IsFunction()) {
    69         if (ScriptExecutionContext* context = getScriptExecutionContext())
    70             context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.", 0, String(), 0);
     66        if (V8Proxy* proxy = V8Proxy::retrieve()) {
     67            if (Frame* frame = proxy->frame())
     68                logInfo(frame, "XPathNSResolver does not have a lookupNamespaceURI method.", String());
     69        }
    7170        return String();
    7271    }
Note: See TracChangeset for help on using the changeset viewer.