diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 14:36:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:38:30 +0100 |
commit | f05b935882198ccf7d81675736e3aeb089c5113a (patch) | |
tree | 4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /Tools/iExploder/iexploder-1.7.2/tools | |
parent | 60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff) | |
download | external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2 |
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'Tools/iExploder/iexploder-1.7.2/tools')
4 files changed, 290 insertions, 0 deletions
diff --git a/Tools/iExploder/iexploder-1.7.2/tools/lasthit.rb b/Tools/iExploder/iexploder-1.7.2/tools/lasthit.rb new file mode 100755 index 0000000..d792d1b --- /dev/null +++ b/Tools/iExploder/iexploder-1.7.2/tools/lasthit.rb @@ -0,0 +1,74 @@ +#!/usr/bin/ruby +# Copyright 2010 Thomas Stromberg - All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# lasthit, part of iExploder +# +# Shows statistics about recent agents that have tested with iExploder. +# It takes all or part of an apache logfile via stdin, and outputs a list +# of all the agents who tested within that section, what their last test +# was, and how many tests they have done. + +# The usefulness is finding out where a browser crashed. + +require 'cgi' + +hostHash = Hash.new + +if (ARGV[0]) + file = File.open(ARGV[0]) +else + puts "No filename specified, waiting for data via stdin..." + file = $stdin +end + +last_index = nil +file.readlines.each_with_index { |line, index| + # filter out mime hits as they produce a lot of odd user agents + next if line =~ /&m=/ + if (line =~ /([\w\.]+) - - .*iexploder.cgi\?(.*?)&b=([\w\%-\.+]+)/) + host = $1 + test_url = $2 + agent = $3 + if (! hostHash[host]) + hostHash[host] = Hash.new + end + if (! hostHash[host][agent]) + hostHash[host][agent] = Hash.new + hostHash[host][agent]['total'] = 0 + end + hostHash[host][agent]['last'] = test_url + hostHash[host][agent]['total'] = hostHash[host][agent]['total'] + 1 + hostHash[host][agent]['last_line'] = index + end + last_index = index +} + +printf("%-14.14s | %-25.25s | %6.6s | %7.7s | %s\n", + "Host", "Test URL", "Total", "LineAgo", "Agent") +puts "-" * 78 +hostHash.each_key { |host| + hostHash[host].each_key { |agent| + next if agent.length < 8 + display_agent = CGI::unescape(agent).sub('U; ', '') + printf("%-14.14s | %-25.25s | %6.6s | %7.7s | %s\n", + host, hostHash[host][agent]['last'], + hostHash[host][agent]['total'], + hostHash[host][agent]['last_line'] - last_index, + display_agent); + } +} + diff --git a/Tools/iExploder/iexploder-1.7.2/tools/osx_last_crash.rb b/Tools/iExploder/iexploder-1.7.2/tools/osx_last_crash.rb new file mode 100755 index 0000000..d95296d --- /dev/null +++ b/Tools/iExploder/iexploder-1.7.2/tools/osx_last_crash.rb @@ -0,0 +1,63 @@ +#!/usr/bin/ruby +# Copyright 2010 Thomas Stromberg - All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# Gives you information about the most recent crash for each application +# that has crashed within the last 2 days + +$LogDir=ENV['HOME'] + '/Library/Logs/CrashReporter' +$Days=1 +$StackCount=5 + +files=`find #$LogDir -mtime -#$Days -type f | grep -v synergy` +files.each { |filename| + filename.chop! + record = 0 + date='' + stackTrace = [] + + File.open(filename).readlines.each { |line| + #puts line + + if line =~ /^Date.*(200.*)/ + date = $1 + end + + if line =~ /^Thread \d+ Crashed/ + record = 1 + # reset the stack trace + stackTrace = [] + end + + if record + stackTrace << line + record = record + 1 + + # stop recording after $StackCount lines + if record > ($StackCount + 2) + record = nil + end + end + } + + puts File.basename(filename) + " - " + date + puts "===================================================" + stackTrace.each { |line| + puts line + } + puts "" +} + + diff --git a/Tools/iExploder/iexploder-1.7.2/tools/release_src.sh b/Tools/iExploder/iexploder-1.7.2/tools/release_src.sh new file mode 100755 index 0000000..5fb625e --- /dev/null +++ b/Tools/iExploder/iexploder-1.7.2/tools/release_src.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Create a tarball from the subversion repository. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +tmp=$$ +cd /tmp +svn checkout http://iexploder.googlecode.com/svn/trunk/ iexploder-$$ +version=`grep '^\$VERSION' iexploder-$$/src/version.rb | cut -d\" -f2` +echo "Version: $version" +mv iexploder-$$ iexploder-$version +cd iexploder-$version +svn log > ChangeLog.txt +find . -name "*.pyc" -delete +find . -name ".svn" -exec rm -Rf {} \; 2>/dev/null +cd .. +GZIP="-9" tar -zcvf iexploder-${version}.tgz iexploder-${version}/ +rm -Rf iexploder-${version} diff --git a/Tools/iExploder/iexploder-1.7.2/tools/update_html_tags_from_sources.sh b/Tools/iExploder/iexploder-1.7.2/tools/update_html_tags_from_sources.sh new file mode 100755 index 0000000..f681743 --- /dev/null +++ b/Tools/iExploder/iexploder-1.7.2/tools/update_html_tags_from_sources.sh @@ -0,0 +1,125 @@ +#!/bin/sh +# +# This script imports HTML and CSS tags from source trees. Supported browsers: +# +# * WebKit +# * Firefox +# * dillo +# * gtkhtml + +src_dir=$1 +tools_dir=`dirname $0` +dest_dir="$tools_dir/../src" +tmp_prefix="/tmp/$$" + +if [ -z "$src_dir" ]; then + echo "You must define a source directory to examine." +fi + +if [ ! -d "$dest_dir" ]; then + echo "Unable to find htdocs directory. Tried $dest_dir" + exit 1 +fi + + +if [ -d "$src_dir/WebKit" ]; then + # Tested as of WebKit-r55454 + source_name="webkit" + grep -v "^#" $src_dir/WebCore/css/CSSPropertyNames.in > ${tmp_prefix}.css-properties + grep -v "^#" $src_dir/WebCore/css/CSSValueKeywords.in > ${tmp_prefix}.css-values + grep -v "^#" $src_dir/WebCore/html/HTMLAttributeNames.in | cut -d" " -f1 | \ + egrep -v "^namespace\w*=" > ${tmp_prefix}.html-attrs + grep -v "^#" $src_dir/WebCore/html/HTMLTagNames.in | cut -d" " -f1 | \ + egrep -v "^namespace\w*=" > ${tmp_prefix}.html-tags + egrep "equalIgnoringCase" $src_dir/WebCore/html/HTML*.cpp | \ + ruby -e '$stdin.readlines.join("").scan(/\"([\w-]+)"/) { |tag| puts tag }' > ${tmp_prefix}.html-values + grep -r "protocolIs" $src_dir/WebCore/* | ruby -e '$stdin.readlines.join("").scan(/\"([\w-]+)"/) { |tag| puts "#{tag}:" }' > ${tmp_prefix}.protocols + grep "map->add" $src_dir/WebCore/html/HTMLInputElement.cpp | cut -d\" -f2 >> ${tmp_prefix}.html-values + grep "AtomicString,.*Header, (" $src_dir/WebCore/platform/network/ResourceResponseBase.cpp | cut -d\" -f2 > ${tmp_prefix}.headers + grep -o -r 'httpHeaderField(".*"' $src_dir | cut -d\" -f2 >> ${tmp_prefix}.headers + egrep -r '"[-\+a-z]+/[-\+a-z]+"' $src_dir/WebCore | ruby -e '$stdin.readlines.join("").scan(/\"([afimtvwx][\w\+-]+\/[\w\+-]+)"/) { puts $1 }' > ${tmp_prefix}.mime-types + grep DEFINE_STATIC $src_dir/WebCore/css/CSSSelector.cpp | cut -d\" -f2 \ + > ${tmp_prefix}.css-pseudo + egrep -o '"@.*?\"' $src_dir/WebCore/css/CSSParser.cpp | cut -d\" -f2 | cut -d"{" -f1 | \ + sed s/" "// > ${tmp_prefix}.css-atrules +elif [ -d "$src_dir/xpcom" ]; then + # Tested as of Sep 1 2010 + source_name="mozilla" + grep "^HTML_.*TAG" $src_dir/parser/htmlparser/public/nsHTMLTagList.h \ + | cut -d\( -f2 | cut -d, -f1 | cut -d\) -f1 > ${tmp_prefix}.html-tags + grep -r "Get.*Attr.*nsGkAtoms" $src_dir | perl -ne 'if (/nsGkAtoms::(\w+)/) { print "$1\n" } '\ + | xargs -n1 -I{} grep "({}," $src_dir/content/base/src/nsGkAtomList.h \ + | cut -d\" -f2 > ${tmp_prefix}.html-attrs + grep "nsHtml5AttributeName.*nsHtml5Atoms::" $src_dir/parser/html/nsHtml5AttributeName.cpp \ + | cut -d: -f3 | cut -d\) -f1 | cut -d, -f1 | xargs -n1 -I{} grep "({}," $src_dir/parser/html/nsHtml5AtomList.h \ + | cut -d\" -f2 >> ${tmp_prefix}.html-attrs + egrep "^ [a-z-]+," $src_dir/layout/style/nsCSSPropList.h | cut -d, -f1 \ + | awk '{ print $1 }' > ${tmp_prefix}.css-properties + grep 'CSS_KEY(' $src_dir/layout/style/nsCSSKeywordList.h | cut -d"(" -f2 \ + | cut -d, -f1 > ${tmp_prefix}.css-values + egrep '{ "[a-z]+:' $src_dir/docshell/build/nsDocShellModule.cpp | cut -d\" -f2 \ + > ${tmp_prefix}.protocols + grep -r 'aURI->SchemeIs("' $src_dir/* | cut -d\" -f2 | perl -ne 'chomp; print "$_:\n";' >> ${tmp_prefix}.protocols + grep -r 'uri->SchemeIs("' $src_dir/* | cut -d\" -f2 | perl -ne 'chomp; print "$_:\n";' >> ${tmp_prefix}.protocols + grep "{ \"" $src_dir/docshell/base/nsAboutRedirector.cpp | cut -d\" -f2 \ + | xargs -I{} echo "about:{}" >> ${tmp_prefix}.protocols + grep targetScheme.EqualsLiteral $src_dir/netwerk/base/public/nsNetUtil.h \ + | cut -d\" -f2 | sed s/$/:/g>> ${tmp_prefix}.protocols + grep "name.LowerCaseEqualsLiteral" $src_dir/docshell/base/nsDocShell.cpp | cut -d\" -f2 >> ${tmp_prefix}.html-values + egrep ' { "[a-z]+' $src_dir/content/html/content/src/nsGenericHTMLElement.cpp | cut -d\" -f2 >> ${tmp_prefix}.html-values + grep ' { "' $src_dir/content/html/content/src/nsHTMLInputElement.cpp | cut -d\" -f2 >> ${tmp_prefix}.html-values + grep -r value.LowerCaseEqualsLiteral $src_dir/content/base/src/* | cut -d\" -f2 >> ${tmp_prefix}.html-values + grep "^HTTP_ATOM" $src_dir/netwerk/protocol/http/nsHttpAtomList.h | cut -d\" -f2 \ + | grep '[a-z]'>> ${tmp_prefix}.headers + egrep -r '"[-\+a-z]+/[-\+a-z]+"' $src_dir/browser/base $src_dir/browser/components $src_dir/uriloader $src_dir/netwerk/mime $src_dir/content/html \ + | ruby -e '$stdin.readlines.join("").scan(/\"([afimtvwx][\w\+-]+\/[\w\+-]+)"/) { puts $1 }' > ${tmp_prefix}.mime-types + egrep -o '":(.*?)"' $src_dir/layout/style/nsCSSPseudoClassList.h | cut -d\" -f2 \ + | sed s/^:// > ${tmp_prefix}.css-pseudo + grep AssignLiteral $src_dir/layout/style/nsCSSRules.cpp | egrep -o '"@.*?"' \ + | cut -d\" -f2 | cut -d" " -f1 > ${tmp_prefix}.css-atrules +elif [ -f "$src_dir/dillorc" ]; then + # Tested as of dillo 2.2 + source_name="dillo" + grep '{"' $src_dir/src/cssparser.cc | cut -d\" -f2 > ${tmp_prefix}.css-properties + egrep '^ +\"[a-z-]+\", ' $src_dir/src/cssparser.cc | \ + ruby -e '$stdin.readlines.join("").scan(/\"(.*?)\"/) { |tag| puts tag }' > ${tmp_prefix}.css-values + grep "_get_attr(html" $src_dir/src/html.cc | grep '"' | cut -d\" -f2 > ${tmp_prefix}.html-attrs + grep 'a_Html_get_attr(html.*"' $src_dir/src/*.cc | cut -d\" -f2 >> ${tmp_prefix}.html-attrs + grep Html_tag_open_ $src_dir/src/html.cc | grep "^ {" | cut -d\" -f2 > ${tmp_prefix}.html-tags + grep dStrcasecmp $src_dir/src/form.cc $src_dir/src/html.cc $src_dir/src/table.cc | \ + ruby -e '$stdin.readlines.join("").scan(/\"([-a-z]+)\"/) { |tag| puts tag }' > ${tmp_prefix}.html-values + grep -r 'URL_SCHEME.*"[a-z]' $src_dir | cut -d \" -f2 | perl -ne 'chomp; print "$_:\n";' > ${tmp_prefix}.protocols + grep -r 'header, "' $src_dir/src/cache.c | cut -d\" -f2 > ${tmp_prefix}.headers + egrep -r "[-\+a-z]+/[-\+a-z]+" $src_dir/dpi $src_dir/src | \ + ruby -e '$stdin.readlines.join("").scan(/\"([\w\+-]+\/[\w\+-]+)"/) { puts $1 }' > ${tmp_prefix}.mime-types +elif [ -d "$src_dir/gtkhtml" ]; then + # tested as of gtkhtml-3.29.91 + source_name="gtkhtml" + grep -r "#define ID_" $src_dir/gtkhtml/htmlengine.c | cut -d\" -f2 | egrep '^[a-z]' > ${tmp_prefix}.html-tags + grep "html_element_get_attr" $src_dir/gtkhtml/*.c | cut -d\" -f2 > ${tmp_prefix}.html-attrs + grep -r "g_ascii_strncasecmp" $src_dir/gtkhtml/*.c | cut -d\" -f2 | grep -v ":" | cut -d"=" -f1 | grep "^[a-z]" > ${tmp_prefix}.html-attrs + grep "g_ascii_strncasecmp" $src_dir/gtkhtml/htmlstyle.c | cut -d\" -f2 | cut -d" " -f1 | sed s/://g > ${tmp_prefix}.css-properties + grep "g_ascii_strcasecmp" $src_dir/gtkhtml/htmlstyle.c | cut -d\" -f2 > ${tmp_prefix}.css-values + grep g_ascii_strcasecmp $src_dir/gtkhtml/htmlengine.c | ruby -e '$stdin.readlines.join("").scan(/\"([\/\w-]+)"/) { |tag| puts tag }' > ${tmp_prefix}.html-values +fi + +if [ "$source_name" ]; then + echo "Updating $source_name" + # We always append, never remove. + types="css-properties css-values html-attrs html-tags html-values protocols headers mime-types css-pseudo css-atrules" + for type in $types + do + if [ -f "${tmp_prefix}.${type}" ]; then + if [ -s "${tmp_prefix}.${type}" ]; then + echo "- $type" + cat $dest_dir/$type/$source_name ${tmp_prefix}.${type} | sort -u > $dest_dir/$type/$source_name + else + echo "- Unable to parse ${type}, source code is incompatible (skipping)" + fi + rm -f "${tmp_prefix}.${type}" + fi + done +else + echo "Could not identify the correct source type for $src_dir" +fi + |