Changeset 31950 in webkit
- Timestamp:
- Apr 16, 2008 12:18:11 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31948 r31950 1 2008-04-15 Adam Roben <aroben@apple.com> 2 3 Pass JSConsole's arguments unmodified to Console 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 All of JSConsole's methods are now custom, so that we can pass the 11 arguments unmodified to Console. Console now handles calling 12 toString() on the first argument. Later it will pass the arguments off 13 to InspectorController. 14 15 There should be no behavioral changes caused by this patch. 16 17 Reviewed by Darin Adler. 18 19 * ForwardingHeaders/kjs/list.h: Added. 20 * GNUmakefile.am: Added JSConsoleCustom.cpp to the project. 21 * WebCore.pro: Ditto. 22 * WebCore.vcproj/WebCore.vcproj: Ditto. 23 * WebCore.xcodeproj/project.pbxproj: Ditto. 24 * WebCoreSources.bkl: Ditto. 25 * bindings/js/JSConsoleCustom.cpp: Added. 26 (WebCore::JSConsole::error): 27 (WebCore::JSConsole::info): 28 (WebCore::JSConsole::log): 29 (WebCore::JSConsole::warn): 30 * page/Console.cpp: Changed all methods to take an ExecState* and a 31 const List&. The first item in the List is toString()ed and passed to 32 Chrome. 33 (WebCore::Console::error): 34 (WebCore::Console::info): 35 (WebCore::Console::log): 36 (WebCore::Console::warn): 37 * page/Console.h: 38 * page/Console.idl: 39 1 40 2008-04-16 Sam Weinig <sam@webkit.org> 2 41 -
trunk/WebCore/GNUmakefile.am
r31893 r31950 474 474 WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp \ 475 475 WebCore/bindings/js/JSClipboardCustom.cpp \ 476 WebCore/bindings/js/JSConsoleCustom.cpp \ 476 477 WebCore/bindings/js/JSCSSRuleCustom.cpp \ 477 478 WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp \ -
trunk/WebCore/WebCore.pro
r31899 r31950 406 406 bindings/js/JSCanvasRenderingContext2DCustom.cpp \ 407 407 bindings/js/JSClipboardCustom.cpp \ 408 bindings/js/JSConsoleCustom.cpp \ 408 409 bindings/js/JSCSSRuleCustom.cpp \ 409 410 bindings/js/JSCSSStyleDeclarationCustom.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r31923 r31950 13095 13095 </File> 13096 13096 <File 13097 RelativePath="..\bindings\js\JSConsoleCustom.cpp" 13098 > 13099 </File> 13100 <File 13097 13101 RelativePath="..\bindings\js\JSCSSRuleCustom.cpp" 13098 13102 > … … 15700 15704 <File 15701 15705 RelativePath="..\ForwardingHeaders\kjs\JSLock.h" 15706 > 15707 </File> 15708 <File 15709 RelativePath="..\ForwardingHeaders\kjs\list.h" 15702 15710 > 15703 15711 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r31923 r31950 3848 3848 C091588E0DB4209200E55AF4 /* JSQuarantinedObjectWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C09158880DB4209200E55AF4 /* JSQuarantinedObjectWrapper.cpp */; }; 3849 3849 C091588F0DB4209200E55AF4 /* JSQuarantinedObjectWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = C09158890DB4209200E55AF4 /* JSQuarantinedObjectWrapper.h */; }; 3850 C0DFC8700DB6841A003EAE7C /* JSConsoleCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */; }; 3850 3851 C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */; }; 3851 3852 C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */; }; … … 8137 8138 C09158880DB4209200E55AF4 /* JSQuarantinedObjectWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSQuarantinedObjectWrapper.cpp; sourceTree = "<group>"; }; 8138 8139 C09158890DB4209200E55AF4 /* JSQuarantinedObjectWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSQuarantinedObjectWrapper.h; sourceTree = "<group>"; }; 8140 C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsoleCustom.cpp; sourceTree = "<group>"; }; 8139 8141 C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; }; 8140 8142 C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; }; … … 11973 11975 E4EEFFC60D34550C00469A58 /* JSAudioConstructor.cpp */, 11974 11976 E4EEFFC70D34550C00469A58 /* JSAudioConstructor.h */, 11977 C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */, 11975 11978 E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */, 11976 11979 E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */, … … 16590 16593 1A8F6BC20DB55CDC001DB794 /* DOMApplicationCache.cpp in Sources */, 16591 16594 1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */, 16595 C0DFC8700DB6841A003EAE7C /* JSConsoleCustom.cpp in Sources */, 16592 16596 ); 16593 16597 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/WebCoreSources.bkl
r31893 r31950 40 40 bindings/js/JSCanvasRenderingContext2DCustom.cpp 41 41 bindings/js/JSClipboardCustom.cpp 42 bindings/js/JSConsoleCustom.cpp 42 43 bindings/js/JSCSSRuleCustom.cpp 43 44 bindings/js/JSCSSStyleDeclarationCustom.cpp -
trunk/WebCore/page/Console.cpp
r30434 r31950 35 35 #include "Page.h" 36 36 #include "PlatformString.h" 37 #include <kjs/list.h> 38 39 using namespace KJS; 37 40 38 41 namespace WebCore { … … 48 51 } 49 52 50 void Console::error( const String& message)53 void Console::error(ExecState* exec, const List& arguments) 51 54 { 55 if (arguments.isEmpty()) 56 return; 57 52 58 if (!m_frame) 53 59 return; … … 57 63 return; 58 64 59 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 0, m_frame->loader()->url().prettyURL());65 page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 60 66 } 61 67 62 void Console::info( const String& message)68 void Console::info(ExecState* exec, const List& arguments) 63 69 { 70 if (arguments.isEmpty()) 71 return; 72 64 73 if (!m_frame) 65 74 return; … … 69 78 return; 70 79 71 page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, message, 0, m_frame->loader()->url().prettyURL());80 page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 72 81 } 73 82 74 void Console::log( const String& message)83 void Console::log(ExecState* exec, const List& arguments) 75 84 { 85 if (arguments.isEmpty()) 86 return; 87 76 88 if (!m_frame) 77 89 return; … … 81 93 return; 82 94 83 page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, message, 0, m_frame->loader()->url().prettyURL());95 page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 84 96 } 85 97 86 void Console::warn( const String& message)98 void Console::warn(ExecState* exec, const List& arguments) 87 99 { 100 if (arguments.isEmpty()) 101 return; 102 88 103 if (!m_frame) 89 104 return; … … 93 108 return; 94 109 95 page->chrome()->addMessageToConsole(JSMessageSource, WarningMessageLevel, message, 0, m_frame->loader()->url().prettyURL());110 page->chrome()->addMessageToConsole(JSMessageSource, WarningMessageLevel, arguments[0]->toString(exec), 0, m_frame->loader()->url().prettyURL()); 96 111 } 97 112 -
trunk/WebCore/page/Console.h
r30434 r31950 31 31 32 32 #include <wtf/RefCounted.h> 33 #include "PlatformString.h" 33 34 #include <wtf/PassRefPtr.h> 35 36 namespace KJS { 37 class ExecState; 38 class List; 39 } 34 40 35 41 namespace WebCore { … … 43 49 void disconnectFrame(); 44 50 45 void error( const String& message);46 void info( const String& message);47 void log( const String& message);48 void warn( const String& message);51 void error(KJS::ExecState*, const KJS::List& arguments); 52 void info(KJS::ExecState*, const KJS::List& arguments); 53 void log(KJS::ExecState*, const KJS::List& arguments); 54 void warn(KJS::ExecState*, const KJS::List& arguments); 49 55 50 56 private: -
trunk/WebCore/page/Console.idl
r29672 r31950 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 interface Console { 32 void error(in DOMString message);33 void info(in DOMString message);34 void log(in DOMString message);35 void warn(in DOMString message);32 [Custom] void error(); 33 [Custom] void info(); 34 [Custom] void log(); 35 [Custom] void warn(); 36 36 }; 37 37
Note: See TracChangeset
for help on using the changeset viewer.