Changeset 31951 in webkit
- Timestamp:
- Apr 16, 2008 12:19:00 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31950 r31951 1 2008-04-15 Adam Roben <aroben@apple.com> 2 3 Change calls to Chrome::addMessageToConsole to use Console::addMessage 4 5 Part of Bug 17228: console.{log,warn,info,error} should support format 6 strings, variable arguments 7 <http://bugs.webkit.org/show_bug.cgi?id=17228> 8 <rdar://problem/5732828> 9 10 Console now takes care of calling ChromeClient::addMessageToConsole 11 for the appropriate messages (i.e., just messages from JavaScript). If 12 you ever want to add a message to the console, Console is the place to 13 do it. 14 15 Reviewed by Darin Adler. 16 17 * WebCore.xcodeproj/project.pbxproj: Mark Console.h Private. 18 * page/Chrome.cpp: Removed addMessageToConsole 19 * page/Chrome.h: Moved MessageSource/MessageLevel to Console.h. 20 * page/Console.cpp: 21 (WebCore::Console::addMessage): Added. Calls 22 ChromeClient::addMessageToConsole for JS messages, and calls 23 InspectorController::addMessageToConsole for all messages. 24 (WebCore::Console::error): Changed to call directly to 25 InspectorController in addition to ChromeClient. 26 (WebCore::Console::info): Ditto. 27 (WebCore::Console::log): Ditto. 28 (WebCore::Console::warn): Ditto. 29 * page/Console.h: Added MessageSource/MessageLevel enums from Chrome.h. 30 1 31 2008-04-15 Adam Roben <aroben@apple.com> 2 32 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r31950 r31951 3532 3532 BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = BC073BA90C399B1F000F5979 /* FloatConversion.h */; }; 3533 3533 BC0B36A40CD3C67C00AC7EB5 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */; }; 3534 BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0B36A20CD3C67C00AC7EB5 /* Console.h */; };3534 BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0B36A20CD3C67C00AC7EB5 /* Console.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3535 3535 BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EE40C2641CD009E2349 /* BarInfo.cpp */; }; 3536 3536 BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EE50C2641CD009E2349 /* BarInfo.h */; }; -
trunk/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp
r30325 r31951 31 31 32 32 #include "CString.h" 33 #include "Console.h" 34 #include "DOMWindow.h" 33 35 #include "Frame.h" 34 36 #include "kjs_proxy.h" 35 37 #include "JSSQLResultSet.h" 36 38 #include "JSSQLTransaction.h" 37 #include "Page.h"38 39 39 40 namespace WebCore { … … 93 94 if (Interpreter::shouldPrintExceptions()) 94 95 printf("SQLStatementCallback: %s\n", message.utf8().data()); 95 if (Page* page = m_frame->page()) 96 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 96 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 97 97 98 98 raisedException = true; -
trunk/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
r30325 r31951 31 31 32 32 #include "CString.h" 33 #include "Console.h" 34 #include "DOMWindow.h" 33 35 #include "Frame.h" 34 36 #include "kjs_proxy.h" 35 37 #include "JSSQLError.h" 36 38 #include "JSSQLTransaction.h" 37 #include "Page.h"38 39 39 40 namespace WebCore { … … 94 95 if (Interpreter::shouldPrintExceptions()) 95 96 printf("SQLStatementErrorCallback: %s\n", message.utf8().data()); 96 if (Page* page = m_frame->page()) 97 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 97 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 98 98 exec->clearException(); 99 99 -
trunk/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp
r31730 r31951 31 31 32 32 #include "CString.h" 33 #include "Console.h" 34 #include "DOMWindow.h" 33 35 #include "Frame.h" 34 36 #include "Logging.h" … … 145 147 if (Interpreter::shouldPrintExceptions()) 146 148 printf("SQLTransactionCallback: %s\n", message.utf8().data()); 147 if (Page* page = m_data->frame()->page()) 148 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 149 m_data->frame()->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 149 150 exec->clearException(); 150 151 -
trunk/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp
r30325 r31951 31 31 32 32 #include "CString.h" 33 #include "Console.h" 34 #include "DOMWindow.h" 33 35 #include "Frame.h" 34 36 #include "kjs_proxy.h" 35 37 #include "JSSQLError.h" 36 #include "Page.h"37 38 38 39 namespace WebCore { … … 92 93 if (Interpreter::shouldPrintExceptions()) 93 94 printf("SQLTransactionErrorCallback: %s\n", message.utf8().data()); 94 if (Page* page = m_frame->page()) 95 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 95 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 96 96 exec->clearException(); 97 97 } -
trunk/WebCore/bindings/js/JSCustomVoidCallback.cpp
r30787 r31951 31 31 32 32 #include "CString.h" 33 #include "Console.h" 33 34 #include "DOMWindow.h" 34 35 #include "Frame.h" 35 36 #include "JSDOMWindow.h" 36 #include "Page.h"37 37 #include "kjs_binding.h" 38 38 #include "kjs_proxy.h" … … 92 92 if (Interpreter::shouldPrintExceptions()) 93 93 printf("VoidCallback: %s\n", message.utf8().data()); 94 if (Page* page = m_frame->page()) 95 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 94 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 96 95 exec->clearException(); 97 96 } -
trunk/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
r31530 r31951 30 30 31 31 #include "CString.h" 32 #include "Console.h" 32 33 #include "DOMWindow.h" 33 34 #include "Document.h" … … 35 36 #include "Frame.h" 36 37 #include "JSDOMWindow.h" 37 #include "Page.h"38 38 #include "kjs_binding.h" 39 39 #include "kjs_proxy.h" … … 91 91 if (!lookupNamespaceURIFunc && !m_customResolver->implementsCall()) { 92 92 // FIXME: pass actual line number and source URL. 93 if (Page* page = m_frame->page()) 94 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.", 0, String()); 93 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.", 0, String()); 95 94 return String(); 96 95 } … … 117 116 if (Interpreter::shouldPrintExceptions()) 118 117 printf("XPathNSResolver: %s\n", message.utf8().data()); 119 if (Page* page = m_frame->page()) 120 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 118 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 121 119 exec->clearException(); 122 120 } else { -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r31766 r31951 26 26 #include "Base64.h" 27 27 #include "CString.h" 28 #include "C hrome.h"28 #include "Console.h" 29 29 #include "DOMWindow.h" 30 30 #include "Element.h" … … 844 844 printf("%s", message.utf8().data()); 845 845 846 if (Page* page = frame->page()) 847 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 1, String()); // FIXME: provide a real line number and source URL. 846 frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, 1, String()); // FIXME: provide a real line number and source URL. 848 847 } 849 848 -
trunk/WebCore/bindings/js/ScheduledAction.cpp
r31746 r31951 25 25 26 26 #include "CString.h" 27 #include "C hrome.h"27 #include "Console.h" 28 28 #include "DOMWindow.h" 29 29 #include "Document.h" … … 31 31 #include "FrameLoader.h" 32 32 #include "JSDOMWindow.h" 33 #include "Page.h"34 33 #include "kjs_proxy.h" 35 34 … … 82 81 if (Interpreter::shouldPrintExceptions()) 83 82 printf("(timer):%s\n", message.utf8().data()); 84 if (Page* page = frame->page()) 85 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, String()); 83 frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, String()); 86 84 } 87 85 } -
trunk/WebCore/bindings/js/kjs_events.cpp
r31746 r31951 22 22 23 23 #include "CString.h" 24 #include "C hrome.h"24 #include "Console.h" 25 25 #include "DOMWindow.h" 26 26 #include "Document.h" … … 32 32 #include "JSEvent.h" 33 33 #include "JSEventTargetNode.h" 34 #include "Page.h"35 34 #include "kjs_proxy.h" 36 35 #include <kjs/function_object.h> … … 111 110 if (Interpreter::shouldPrintExceptions()) 112 111 printf("(event handler):%s\n", message.utf8().data()); 113 if (Page* page = frame->page()) 114 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 112 frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL); 115 113 exec->clearException(); 116 114 } else { -
trunk/WebCore/bindings/js/kjs_proxy.cpp
r31766 r31951 22 22 #include "kjs_proxy.h" 23 23 24 #include "Chrome.h" 24 #include "Console.h" 25 #include "DOMWindow.h" 25 26 #include "Document.h" 26 27 #include "Event.h" … … 96 97 int lineNumber = comp.value()->toObject(exec)->get(exec, "line")->toInt32(exec); 97 98 UString sourceURL = comp.value()->toObject(exec)->get(exec, "sourceURL")->toString(exec); 98 if (Page* page = m_frame->page()) 99 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, errorMessage, lineNumber, sourceURL); 99 m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, errorMessage, lineNumber, sourceURL); 100 100 } 101 101 -
trunk/WebCore/html/HTMLParser.cpp
r31358 r31951 29 29 #include "CSSValueKeywords.h" 30 30 #include "Comment.h" 31 #include "Console.h" 32 #include "DOMWindow.h" 31 33 #include "DocumentFragment.h" 32 34 #include "DocumentType.h" … … 49 51 #include "HTMLTokenizer.h" 50 52 #include "LocalizedStrings.h" 51 #include "Page.h"52 53 #include "Settings.h" 53 54 #include "Text.h" … … 1455 1456 return; 1456 1457 1457 Page* page = frame->page();1458 if (!page)1459 return;1460 1461 1458 HTMLTokenizer* htmlTokenizer = static_cast<HTMLTokenizer*>(document->tokenizer()); 1462 1459 int lineNumber = htmlTokenizer->lineNumber() + 1; … … 1492 1489 message.replace("%tag2", tag2); 1493 1490 1494 page->chrome()->addMessageToConsole(HTMLMessageSource,1491 frame->domWindow()->console()->addMessage(HTMLMessageSource, 1495 1492 isWarning(errorCode) ? WarningMessageLevel : ErrorMessageLevel, 1496 1493 message, lineNumber, document->url().string()); -
trunk/WebCore/loader/Cache.cpp
r31307 r31951 105 105 Document* doc = docLoader->doc(); 106 106 if(doc && !isPreload) 107 FrameLoader::reportLocalLoadFailed(doc-> page(), resource->url());107 FrameLoader::reportLocalLoadFailed(doc->frame(), resource->url()); 108 108 return 0; 109 109 } … … 112 112 Document* doc = docLoader->doc(); 113 113 if(doc && !isPreload) 114 FrameLoader::reportLocalLoadFailed(doc-> page(), url.string());114 FrameLoader::reportLocalLoadFailed(doc->frame(), url.string()); 115 115 return 0; 116 116 } -
trunk/WebCore/loader/FrameLoader.cpp
r31816 r31951 38 38 #include "Chrome.h" 39 39 #include "DOMImplementation.h" 40 #include "DOMWindow.h" 40 41 #include "DocLoader.h" 41 42 #include "Document.h" … … 462 463 463 464 if (!canLoad(url, referrer)) { 464 FrameLoader::reportLocalLoadFailed(m_frame ->page(), url.string());465 FrameLoader::reportLocalLoadFailed(m_frame, url.string()); 465 466 return 0; 466 467 } … … 1712 1713 1713 1714 if (!canLoad(url, frame()->document())) { 1714 FrameLoader::reportLocalLoadFailed(m_frame ->page(), url.string());1715 FrameLoader::reportLocalLoadFailed(m_frame, url.string()); 1715 1716 return false; 1716 1717 } … … 2036 2037 if (url.protocolIs("file")) { 2037 2038 if (!canLoad(url, frame()->document()) && !canLoad(url, referrer)) { 2038 FrameLoader::reportLocalLoadFailed(m_frame ->page(), url.string());2039 FrameLoader::reportLocalLoadFailed(m_frame, url.string()); 2039 2040 return; 2040 2041 } … … 2251 2252 } 2252 2253 2253 void FrameLoader::reportLocalLoadFailed( const Page* page, const String& url)2254 void FrameLoader::reportLocalLoadFailed(Frame* frame, const String& url) 2254 2255 { 2255 2256 ASSERT(!url.isEmpty()); 2256 if (page) 2257 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, "Not allowed to load local resource: " + url, 0, String()); 2257 if (!frame) 2258 return; 2259 2260 frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, "Not allowed to load local resource: " + url, 0, String()); 2258 2261 } 2259 2262 … … 2448 2451 2449 2452 // FIXME: should we print to the console of the activeFrame as well? 2450 if (Page* page = targetFrame->page()) 2451 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 1, String()); 2453 targetFrame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, 1, String()); 2452 2454 } 2453 2455 -
trunk/WebCore/loader/FrameLoader.h
r31816 r31951 166 166 static bool canLoad(const KURL&, const Document*); 167 167 static bool canLoad(const CachedResource&, const Document*); 168 static void reportLocalLoadFailed( const Page*, const String& url);168 static void reportLocalLoadFailed(Frame*, const String& url); 169 169 170 170 static bool shouldHideReferrer(const KURL& url, const String& referrer); -
trunk/WebCore/loader/SubresourceLoader.cpp
r31203 r31951 97 97 && FrameLoader::restrictAccessToLocal() 98 98 && !FrameLoader::canLoad(request.url(), frame->document())) { 99 FrameLoader::reportLocalLoadFailed(frame ->page(), request.url().string());99 FrameLoader::reportLocalLoadFailed(frame, request.url().string()); 100 100 return 0; 101 101 } -
trunk/WebCore/page/Chrome.cpp
r30900 r31951 31 31 #include "HTMLNames.h" 32 32 #include "HitTestResult.h" 33 #include "InspectorController.h"34 33 #include "JSDOMWindow.h" 35 34 #include "Page.h" … … 194 193 } 195 194 196 void Chrome::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)197 {198 if (source == JSMessageSource)199 m_client->addMessageToConsole(message, lineNumber, sourceID);200 201 m_page->inspectorController()->addMessageToConsole(source, level, message, lineNumber, sourceID);202 }203 204 195 bool Chrome::canRunBeforeUnloadConfirmPanel() 205 196 { -
trunk/WebCore/page/Chrome.h
r29698 r31951 47 47 struct WindowFeatures; 48 48 49 enum MessageSource {50 HTMLMessageSource,51 XMLMessageSource,52 JSMessageSource,53 CSSMessageSource,54 OtherMessageSource55 };56 57 enum MessageLevel {58 TipMessageLevel,59 LogMessageLevel,60 WarningMessageLevel,61 ErrorMessageLevel62 };63 64 49 class Chrome : Noncopyable { 65 50 public: … … 103 88 void setResizable(bool) const; 104 89 105 void addMessageToConsole(MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);106 107 90 bool canRunBeforeUnloadConfirmPanel(); 108 91 bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); -
trunk/WebCore/page/Console.cpp
r31950 r31951 30 30 #include "Console.h" 31 31 32 #include "Chrome .h"32 #include "ChromeClient.h" 33 33 #include "Frame.h" 34 34 #include "FrameLoader.h" 35 #include "InspectorController.h" 35 36 #include "Page.h" 36 37 #include "PlatformString.h" … … 51 52 } 52 53 54 void Console::addMessage(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL) 55 { 56 if (!m_frame) 57 return; 58 59 Page* page = m_frame->page(); 60 if (!page) 61 return; 62 63 if (source == JSMessageSource) 64 page->chrome()->client()->addMessageToConsole(message, lineNumber, sourceURL); 65 66 page->inspectorController()->addMessageToConsole(source, level, message, lineNumber, sourceURL); 67 } 68 53 69 void Console::error(ExecState* exec, const List& arguments) 54 70 { … … 63 79 return; 64 80 65 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 81 String message = arguments[0]->toString(exec); 82 String url = m_frame->loader()->url().prettyURL(); 83 84 page->chrome()->client()->addMessageToConsole(message, 0, url); 85 page->inspectorController()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 0, url); 66 86 } 67 87 … … 78 98 return; 79 99 80 page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 100 String message = arguments[0]->toString(exec); 101 String url = m_frame->loader()->url().prettyURL(); 102 103 page->chrome()->client()->addMessageToConsole(message, 0, url); 104 page->inspectorController()->addMessageToConsole(JSMessageSource, LogMessageLevel, message, 0, url); 81 105 } 82 106 … … 93 117 return; 94 118 95 page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 119 String message = arguments[0]->toString(exec); 120 String url = m_frame->loader()->url().prettyURL(); 121 122 page->chrome()->client()->addMessageToConsole(message, 0, url); 123 page->inspectorController()->addMessageToConsole(JSMessageSource, LogMessageLevel, message, 0, url); 96 124 } 97 125 … … 108 136 return; 109 137 110 page->chrome()->addMessageToConsole(JSMessageSource, WarningMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 138 String message = arguments[0]->toString(exec); 139 String url = m_frame->loader()->url().prettyURL(); 140 141 page->chrome()->client()->addMessageToConsole(message, 0, url); 142 page->inspectorController()->addMessageToConsole(JSMessageSource, WarningMessageLevel, message, 0, url); 111 143 } 112 144 -
trunk/WebCore/page/Console.h
r31950 r31951 42 42 43 43 class Frame; 44 class String; 45 46 enum MessageSource { 47 HTMLMessageSource, 48 XMLMessageSource, 49 JSMessageSource, 50 CSSMessageSource, 51 OtherMessageSource 52 }; 53 54 enum MessageLevel { 55 TipMessageLevel, 56 LogMessageLevel, 57 WarningMessageLevel, 58 ErrorMessageLevel 59 }; 44 60 45 61 class Console : public RefCounted<Console> { … … 48 64 49 65 void disconnectFrame(); 66 67 void addMessage(MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL); 50 68 51 69 void error(KJS::ExecState*, const KJS::List& arguments); -
trunk/WebCore/page/InspectorController.cpp
r31890 r31951 32 32 #include "CString.h" 33 33 #include "CachedResource.h" 34 #include "Console.h" 35 #include "DOMWindow.h" 34 36 #include "DocLoader.h" 35 37 #include "Document.h" … … 1983 1985 String message(JSStringGetCharactersPtr(messageString.get()), JSStringGetLength(messageString.get())); 1984 1986 1985 m_page-> chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, lineNumber, __FILE__);1987 m_page->mainFrame()->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, __FILE__); 1986 1988 return true; 1987 1989 } -
trunk/WebCore/page/InspectorController.h
r31736 r31951 30 30 #define InspectorController_h 31 31 32 #include "C hrome.h"32 #include "Console.h" 33 33 #include <JavaScriptCore/JSContextRef.h> 34 34 #include <wtf/HashMap.h> … … 47 47 class InspectorClient; 48 48 class Node; 49 class Page; 49 50 class ResourceResponse; 50 51 class ResourceError; -
trunk/WebCore/svg/SVGDocumentExtensions.cpp
r31801 r31951 28 28 29 29 #include "AtomicString.h" 30 #include "Chrome.h" 30 #include "Console.h" 31 #include "DOMWindow.h" 31 32 #include "Document.h" 32 33 #include "EventListener.h" … … 98 99 { 99 100 if (Frame* frame = m_doc->frame()) 100 if (Page* page = frame->page()) 101 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, "Warning: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String()); 101 frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, "Warning: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String()); 102 102 } 103 103 … … 105 105 { 106 106 if (Frame* frame = m_doc->frame()) 107 if (Page* page = frame->page()) 108 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, "Error: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String()); 107 frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, "Error: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String()); 109 108 } 110 109 -
trunk/WebCore/xml/XMLHttpRequest.cpp
r31483 r31951 23 23 24 24 #include "CString.h" 25 #include "Console.h" 25 26 #include "DOMImplementation.h" 27 #include "DOMWindow.h" 26 28 #include "Event.h" 27 29 #include "EventException.h" … … 552 554 // A privileged script (e.g. a Dashboard widget) can set any headers. 553 555 if (!m_doc->isAllowedToLoadLocalResources() && !isSafeRequestHeader(name)) { 554 if (m_doc && m_doc->frame() && m_doc->frame()->page())555 m_doc->frame()-> page()->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, "Refused to set unsafe header " + name, 1, String());556 if (m_doc && m_doc->frame()) 557 m_doc->frame()->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, "Refused to set unsafe header " + name, 1, String()); 556 558 return; 557 559 } -
trunk/WebCore/xml/XSLTProcessor.cpp
r31947 r31951 29 29 #include "CString.h" 30 30 #include "Cache.h" 31 #include "Console.h" 31 32 #include "DOMImplementation.h" 33 #include "DOMWindow.h" 32 34 #include "DocLoader.h" 33 35 #include "DocumentFragment.h" … … 76 78 void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error) 77 79 { 78 C hrome* chrome = static_cast<Chrome*>(userData);79 if (!c hrome)80 Console* console = static_cast<Console*>(userData); 81 if (!console) 80 82 return; 81 83 … … 95 97 } 96 98 97 c hrome->addMessageToConsole(XMLMessageSource, level, error->message, error->line, error->file);99 console->addMessage(XMLMessageSource, level, error->message, error->line, error->file); 98 100 } 99 101 … … 124 126 globalDocLoader->frame()->loader()->loadResourceSynchronously(url, error, response, data); 125 127 126 C hrome* chrome = 0;127 if ( Page* page = globalProcessor->xslStylesheet()->ownerDocument()->page())128 c hrome = page->chrome();129 xmlSetStructuredErrorFunc(c hrome, XSLTProcessor::parseErrorFunc);128 Console* console = 0; 129 if (Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame()) 130 console = frame->domWindow()->console(); 131 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); 130 132 131 133 // We don't specify an encoding here. Neither Gecko nor WinIE respects
Note: See TracChangeset
for help on using the changeset viewer.