mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 15:15:23 +00:00
8484d431af
I have changed the usage contract of the DocumentLoadListener slightly. Prior to this checkin, calling getEventData() on the DocumentLoadEvent passed in to your eventDispatched() method returned the URI to which the event applies. Now the getEventData() returns a Map. You must look up the "URI" key to find the URI to which the event applies. If your listener is an instance of PageInfoListener, and your event mask is END_URL_LOAD_EVENT_MASK, your Map will have an additional entry under the key "headers". This entry is another Map representing the response headers. DocumentLoadListener: * <p>The <code>eventDispatched()</code> method is passed a {@link * DocumentLoadEvent} instance. The <code>type</code> property of the * event will be one of the types defined as a <code>public static final * int</code> in <code>DocumentLoadEvent</code>.</p> * * <p>The <code>eventData</code> property of the * <code>DocumentLoadEvent</code> instance will be a * <code>java.util.Map</code>. For all <code>EVENT_MASK</code> types in * <code>DocumentLoadEvent</code> the map will contain an entry under * the key "<code>URI</code>" without the quotes. This will be the * fully qualified URI for the event.</p> * * <p>For the <code>PROGRESS_URL_LOAD_EVENT_MASK</code> there will be an * entry in the map for the key "<code>message</code>". This will be * the progress message from the browser.</p> PageInfoListener: * <p>This {@link DocumentLoadListener} subclass adds the ability to get * detailed information on each event. </p> * * <p>The <code>eventDispatched()</code> method is passed the same thing * as in the {@link DocumentLoadListener}.</p> * * <p>The <code>eventData</code> property of the * <code>DocumentLoadEvent</code> instance will be a * <code>java.util.Map</code>. For the * <code>END_URL_LOAD_EVENT_MASK</code> type in * <code>DocumentLoadEvent</code> the map will contain an entry under * the key "<code>URI</code>" without the quotes. This will be the * fully qualified URI for the event. The map will also contain an * entry under the key "<code>headers</code>". This entry will be a * <code>Map</code> of all the response headers.</p> The next step will be to allow the same procedure to work to discover the request headers. Ed A classes_spec/org/mozilla/webclient/PageInfoListener.java - marker class for listenening for high fidelity page information. A src_moz/EventRegistrationImpl.cpp - add boolean property, capturePageInfo to turn on or off high fidelity page information collection. M build-tests.xml - add new test, DocumentLoadListenerTest M build.xml - added new JNI class, EventRegistrationImpl M classes_spec/org/mozilla/webclient/CurrentPage2.java M classes_spec/org/mozilla/webclient/impl/wrapper_native/CurrentPageImpl.java - rollback previous API for headers discovery M classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java - pass thru the capturePageInfo property - add URIToStringMap, currently not working. M classes_spec/org/mozilla/webclient/test/EMWindow.java - call toString() on the eventData, don't cast it to a String. M src_moz/EmbedProgress.cpp M src_moz/EmbedProgress.h - leverage the nsIHttpHeaderVisitor interface to discover the response headers. - add boolean property capturePageInfo A src_moz/HttpHeaderVisitorImpl.cpp A src_moz/HttpHeaderVisitorImpl.h - copy the headers to a Properties object. M src_moz/Makefile.in - compile two new files: + EventRegistrationImpl.cpp \ + HttpHeaderVisitorImpl.cpp \ M src_moz/NativeBrowserControl.cpp M src_moz/NativeBrowserControl.h - pass the NativeWrapperFactory to our Init() method - add wrapperFactory getter. M src_moz/WrapperFactoryImpl.cpp - pass the nativeWrapperFactory to the NativeBrowserControl's Init method. M src_share/jni_util.cpp M src_share/jni_util.h - new constants: URI, headers R test/automated/src/classes/org/mozilla/webclient/CurrentPageTest.java - not yet time for this one A test/automated/src/classes/org/mozilla/webclient/DocumentLoadListenerTest.java - exercise bare minimum functionality of PageInfoListener M test/manual/src/classes/org/mozilla/webclient/test/TestBrowser.java - print out headers.
325 lines
10 KiB
XML
325 lines
10 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
* License Version 1.1 (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.mozilla.org/NPL/
|
|
*
|
|
* Software distributed under the License is distributed on an "AS
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
* implied. See the License for the specific language governing
|
|
* rights and limitations under the License.
|
|
*
|
|
* The Original Code is mozilla.org code.
|
|
*
|
|
* The Initial Developer of the Original Code is Netscape
|
|
* Communications Corporation. Portions created by Netscape are
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
* Rights Reserved.
|
|
*
|
|
* Contributor(s):
|
|
|
|
* Ed Burns >edburns@acm.org<
|
|
|
|
|
|
-->
|
|
|
|
<project name="webclient" default="main" basedir=".">
|
|
|
|
<property name="Name" value="webclient"/>
|
|
<property name="name" value="webclient"/>
|
|
<property name="version" value="20030906"/>
|
|
|
|
<!-- ************ Per user local properties ******************************* -->
|
|
|
|
<property file="${user.home}/build.properties"/> <!-- User local -->
|
|
<property file="build.properties"/> <!-- Component local -->
|
|
<property file="../build.properties"/> <!-- java-supplement local -->
|
|
<property environment="myenv" />
|
|
|
|
<!-- ************ Compiler Defaults *************************************** -->
|
|
|
|
<!-- Should Java compilations set the 'debug' compiler option? -->
|
|
<property name="compile.debug" value="true"/>
|
|
|
|
<!-- Should Java compilations set the 'deprecation' compiler option? -->
|
|
<property name="compile.deprecation" value="false"/>
|
|
|
|
<!-- Should Java compilations set the 'optimize' compiler option? -->
|
|
<property name="compile.optimize" value="false"/>
|
|
|
|
<!-- ************ Where are we building into? ***************************** -->
|
|
|
|
<!-- The base directory for component sources -->
|
|
<property name="source.home" value="${basedir}/classes_spec"/>
|
|
|
|
<!-- Construct compile classpath -->
|
|
<path id="compile.classpath">
|
|
<pathelement location="${build.home}"/>
|
|
</path>
|
|
|
|
<target name="prepare">
|
|
|
|
<condition property="PATH_SEP" value=";">
|
|
<and>
|
|
<os family="windows" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="PATH_SEP" value=":">
|
|
<and>
|
|
<os family="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
</target>
|
|
|
|
<target name="main"
|
|
depends="prepare,compile.classes_spec,compile.src_share,compile.src_moz,compile.src_ie,create.webclient.scripts"/>
|
|
|
|
<target name="compile.classes_spec">
|
|
|
|
<javac destdir="${build.home}"
|
|
debug="${compile.debug}"
|
|
deprecation="${compile.deprecation}"
|
|
optimize="${compile.optimize}">
|
|
<classpath refid="compile.classpath"/>
|
|
<src path="${source.home}"/>
|
|
<patternset>
|
|
<exclude name="**/Win32*.java" if="build.unix.classes"/>
|
|
</patternset>
|
|
|
|
<patternset>
|
|
<exclude name="**/Gtk*.java" if="build.win32.classes"/>
|
|
</patternset>
|
|
|
|
<!-- PENDING(edburns): include additional patternsets for ICE,
|
|
HotJava, etc -->
|
|
|
|
<include name="org/mozilla/webclient/*"/>
|
|
<include name="org/mozilla/webclient/impl/wrapper_native/*"/>
|
|
<include name="org/mozilla/webclient/impl/*"/>
|
|
<include name="org/mozilla/webclient/test/*"/>
|
|
</javac>
|
|
|
|
<mkdir dir="${build.home}/META-INF/services"/>
|
|
<echo file="${build.home}/META-INF/services/org.mozilla.webclient.WebclientFactory">org.mozilla.webclient.impl.WebclientFactoryImpl</echo>
|
|
<echo file="${build.home}/META-INF/services/org.mozilla.webclient.impl.WrapperFactory">org.mozilla.webclient.impl.wrapper_native.WrapperFactoryImpl</echo>
|
|
|
|
</target>
|
|
|
|
<target name="compile.src_share" depends="compile.javah.headers">
|
|
|
|
<exec os="SunOS" dir="${basedir}/src_share" failonerror="yes"
|
|
executable="gmake"/>
|
|
<exec os="Linux" dir="${basedir}/src_share" failonerror="yes"
|
|
executable="make"/>
|
|
<exec os="Windows 2000" dir="${basedir}/src_share" executable="make"
|
|
failonerror="yes"/>
|
|
|
|
</target>
|
|
|
|
<target name="compile.javah.headers" depends="compile.classes_spec,compile.javah.canvas.headers">
|
|
|
|
<javah destdir="${basedir}/src_share"
|
|
class="org.mozilla.webclient.impl.wrapper_native.BookmarksImpl,org.mozilla.webclient.impl.wrapper_native.ProfileManagerImpl,org.mozilla.webclient.impl.wrapper_native.PreferencesImpl,org.mozilla.webclient.impl.wrapper_native.CurrentPageImpl,org.mozilla.webclient.impl.wrapper_native.HistoryImpl,org.mozilla.webclient.impl.wrapper_native.WrapperFactoryImpl,org.mozilla.webclient.impl.wrapper_native.NavigationImpl,org.mozilla.webclient.impl.wrapper_native.RDFEnumeration,org.mozilla.webclient.impl.wrapper_native.RDFTreeNode,org.mozilla.webclient.impl.wrapper_native.ISupportsPeer,org.mozilla.webclient.impl.wrapper_native.WindowControlImpl,org.mozilla.webclient.impl.wrapper_native.NativeEventThread,org.mozilla.webclient.impl.wrapper_native.EventRegistrationImpl">
|
|
<classpath refid="compile.classpath"/>
|
|
</javah>
|
|
</target>
|
|
|
|
<target name="compile.javah.canvas.headers"
|
|
depends="compile.unix.canvas.headers,compile.win32.canvas.headers"/>
|
|
|
|
<target name="compile.unix.canvas.headers" if="build.unix.classes">
|
|
|
|
<javah destdir="${basedir}/src_moz/gtk"
|
|
class="org.mozilla.webclient.impl.wrapper_native.GtkBrowserControlCanvas">
|
|
<classpath refid="compile.classpath"/>
|
|
</javah>
|
|
|
|
</target>
|
|
|
|
<target name="compile.win32.canvas.headers" if="build.win32.classes">
|
|
|
|
<javah destdir="${basedir}/src_moz/win32"
|
|
class="org.mozilla.webclient.impl.wrapper_native.Win32BrowserControlCanvas">
|
|
<classpath refid="compile.classpath"/>
|
|
</javah>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile.src_moz" depends="compile.src_share">
|
|
|
|
<exec os="SunOS" dir="${basedir}/src_moz" executable="gmake"
|
|
failonerror="yes">
|
|
</exec>
|
|
<exec os="Linux" dir="${basedir}/src_moz" executable="make"
|
|
failonerror="yes">
|
|
</exec>
|
|
<exec os="Windows 2000" dir="${basedir}/src_moz" executable="make"
|
|
failonerror="yes"/>
|
|
|
|
</target>
|
|
|
|
<target name="compile.src_ie" depends="compile.src_share">
|
|
|
|
<!-- PENDING(edburns): re-enable IE support
|
|
<exec os="Windows 2000" dir="${basedir}/src_ie" executable="make"
|
|
failonerror="yes"/>
|
|
-->
|
|
|
|
</target>
|
|
|
|
<target name="create.webclient.scripts"
|
|
depends="create.win32.webclient.scripts,create.unix.webclient.scripts"/>
|
|
|
|
<target name="create.win32.webclient.scripts"
|
|
if="build.win32.classes">
|
|
|
|
<condition property="debug.options" value="${debug.jvm.args}">
|
|
<equals arg1="${myenv.MOZ_DEBUG}" arg2="1"/>
|
|
</condition>
|
|
<condition property="debug.options" value="">
|
|
<not>
|
|
<equals arg1="${myenv.MOZ_DEBUG}" arg2="1"/>
|
|
</not>
|
|
</condition>
|
|
|
|
<echo file="${basedir}/src_moz/runem.bat">set CLASSPATH=${build.home};%CLASSPATH%
|
|
set PATH=%PATH%;${build.home}\..\bin;${build.home}\..\bin\components;${myenv.MOZ_JDKHOME}\jre\bin
|
|
${myenv.MOZ_JDKHOME}/bin/java ${debug.options} org.mozilla.webclient.test.EmbeddedMozillaImpl ${build.home}\..\bin %1%
|
|
</echo>
|
|
</target>
|
|
|
|
<target name="create.unix.webclient.scripts"
|
|
if="build.unix.classes">
|
|
|
|
<condition property="debug.options" value="${debug.jvm.args}">
|
|
<equals arg1="${myenv.MOZ_DEBUG}" arg2="1"/>
|
|
</condition>
|
|
<condition property="debug.options" value="">
|
|
<not>
|
|
<equals arg1="${myenv.MOZ_DEBUG}" arg2="1"/>
|
|
</not>
|
|
</condition>
|
|
|
|
<echo file="${basedir}/src_moz/runem">export CLASSPATH=${build.home}:$CLASSPATH
|
|
export LD_LIBRARY_PATH=${build.home}/../bin:${build.home}/../bin/components:$LD_LIBRARY_PATH:;${myenv.MOZ_JDKHOME}/jre/bin
|
|
${myenv.MOZ_JDKHOME}/bin/java ${debug.options} org.mozilla.webclient.test.EmbeddedMozillaImpl ${build.home}/../bin $*
|
|
</echo>
|
|
<chmod perm="755" file="${basedir}/src_moz/runem"/>
|
|
|
|
</target>
|
|
|
|
<target name="clean.classes_spec">
|
|
<delete dir="${build.home}/org/mozilla/webclient"/>
|
|
</target>
|
|
|
|
<target name="clean.test">
|
|
<ant antfile="build-tests.xml" target="clean"/>
|
|
</target>
|
|
|
|
<target name="clean" depends="clean.classes_spec">
|
|
|
|
<ant antfile="build-tests.xml" target="clean"/>
|
|
<delete>
|
|
<fileset dir="${basedir}/src_moz">
|
|
<include name="**/*BrowserControlCanvas.h"/>
|
|
<exclude name="motif/MotifBrowserControlCanvas.h"/>
|
|
</fileset>
|
|
</delete>
|
|
|
|
<delete >
|
|
<fileset dir="${basedir}/src_share">
|
|
<include name="*.h"/>
|
|
<exclude name="bal_util.h"/>
|
|
<exclude name="jni_util_export.h"/>
|
|
<exclude name="jni_util.h"/>
|
|
</fileset>
|
|
</delete>
|
|
|
|
<delete >
|
|
<fileset dir="${basedir}/src_moz">
|
|
<include name="*.ilk"/>
|
|
</fileset>
|
|
</delete>
|
|
|
|
|
|
<delete >
|
|
<fileset dir="${basedir}/src_ie">
|
|
<include name="*.ilk"/>
|
|
</fileset>
|
|
</delete>
|
|
|
|
<exec os="SunOS" dir="${basedir}/src_moz" executable="gmake"
|
|
failonerror="yes">
|
|
|
|
<arg line="clobber_all"/>
|
|
|
|
</exec>
|
|
<exec os="Linux" dir="${basedir}/src_moz" executable="make"
|
|
failonerror="yes">
|
|
|
|
<arg line="clobber_all"/>
|
|
|
|
</exec>
|
|
<exec os="Windows 2000" dir="${basedir}/src_moz" executable="make"
|
|
failonerror="yes">
|
|
<arg line="clobber_all"/>
|
|
</exec>
|
|
<exec os="Windows 2000" dir="${basedir}/src_ie" executable="make"
|
|
failonerror="yes">
|
|
<arg line="clobber_all"/>
|
|
</exec>
|
|
|
|
<exec os="SunOS" dir="${basedir}/src_share" executable="gmake"
|
|
failonerror="yes">
|
|
|
|
<arg line="clobber_all"/>
|
|
|
|
</exec>
|
|
<exec os="Linux" dir="${basedir}/src_share" executable="make"
|
|
failonerror="yes">
|
|
|
|
<arg line="clobber_all"/>
|
|
|
|
</exec>
|
|
<exec os="Windows 2000" dir="${basedir}/src_share" executable="make"
|
|
failonerror="yes">
|
|
<arg line="clobber_all"/>
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
<target name="test" depends="main"
|
|
description="compile everything and Run unit tests">
|
|
|
|
<antcall target="run.test" />
|
|
|
|
</target>
|
|
|
|
<target name="run.test" description="Run unit tests">
|
|
|
|
<ant antfile="build-tests.xml" target="run.test"/>
|
|
|
|
</target>
|
|
|
|
<target name="run.test.browser" depends="main" description="Run the test browser">
|
|
|
|
<ant antfile="build-tests.xml" target="run.test.browser"/>
|
|
|
|
</target>
|
|
|
|
<target name="compile.test" description="compile unit tests">
|
|
|
|
<ant antfile="build-tests.xml" target="compile.test"/>
|
|
|
|
</target>
|
|
|
|
|
|
</project>
|