Commit 5f1072b8 authored by tonyg@chromium.org's avatar tonyg@chromium.org

2010-07-01 Tony Gentilcore <tonyg@chromium.org>

        Reviewed by Dimitri Glazkov.

        Add window.performance.navigation namespace
        https://bugs.webkit.org/show_bug.cgi?id=41442

        Adds window.performance.navigation namespace consisting of ".type"
        and ".redirectCount". As part of this change, I renmaed "NavigationTiming"
        to just "Timing" to avoid confusion.

        No new tests because tests will be added in a subsequent patch when
        functionality is added.

        * Android.mk:
        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pri:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * page/Navigation.cpp: Added.
        (WebCore::Navigation::Navigation):
        (WebCore::Navigation::frame):
        (WebCore::Navigation::disconnectFrame):
        (WebCore::Navigation::type):
        (WebCore::Navigation::redirectCount):
        * page/Navigation.h: Added.
        (WebCore::Navigation::create):
        * page/Navigation.idl: Added.
        * page/NavigationTiming.cpp: Removed.
        * page/NavigationTiming.h: Removed.
        * page/NavigationTiming.idl: Removed.
        * page/Performance.cpp:
        (WebCore::Performance::navigation):
        (WebCore::Performance::timing):
        * page/Performance.h:
        * page/Performance.idl:
        * page/Timing.cpp: Added.
        (WebCore::Timing::Timing):
        (WebCore::Timing::frame):
        (WebCore::Timing::disconnectFrame):
        (WebCore::Timing::navigationStart):
        * page/Timing.h: Added.
        (WebCore::Timing::create):
        * page/Timing.idl: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@62357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent efe2d762
......@@ -365,7 +365,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
page/History.cpp \
page/Location.cpp \
page/MouseEventWithHitTestResults.cpp \
page/NavigationTiming.cpp \
page/Navigation.cpp \
page/Navigator.cpp \
page/NavigatorBase.cpp \
page/OriginAccessEntry.cpp \
......@@ -380,6 +380,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
page/Settings.cpp \
page/SpatialNavigation.cpp \
page/SuspendableTimer.cpp \
page/Timing.cpp \
page/UserContentURLPattern.cpp \
page/WindowFeatures.cpp \
page/WorkerNavigator.cpp \
......
......@@ -310,11 +310,12 @@ SET(WebCore_IDL_FILES
page/History.idl
page/Location.idl
page/MemoryInfo.idl
page/NavigationTiming.idl
page/Navigation.idl
page/Navigator.idl
page/Performance.idl
page/PositionError.idl
page/Screen.idl
page/Timing.idl
page/WebKitPoint.idl
page/WorkerNavigator.idl
......@@ -1124,7 +1125,7 @@ SET(WebCore_SOURCES
page/Location.cpp
page/MemoryInfo.cpp
page/MouseEventWithHitTestResults.cpp
page/NavigationTiming.cpp
page/Navigation.cpp
page/Navigator.cpp
page/NavigatorBase.cpp
page/OriginAccessEntry.cpp
......@@ -1139,6 +1140,7 @@ SET(WebCore_SOURCES
page/Settings.cpp
page/SpatialNavigation.cpp
page/SuspendableTimer.cpp
page/Timing.cpp
page/UserContentURLPattern.cpp
page/WindowFeatures.cpp
page/WorkerNavigator.cpp
......
2010-07-01 Tony Gentilcore <tonyg@chromium.org>
Reviewed by Dimitri Glazkov.
Add window.performance.navigation namespace
https://bugs.webkit.org/show_bug.cgi?id=41442
Adds window.performance.navigation namespace consisting of ".type"
and ".redirectCount". As part of this change, I renmaed "NavigationTiming"
to just "Timing" to avoid confusion.
No new tests because tests will be added in a subsequent patch when
functionality is added.
* Android.mk:
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pri:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* page/Navigation.cpp: Added.
(WebCore::Navigation::Navigation):
(WebCore::Navigation::frame):
(WebCore::Navigation::disconnectFrame):
(WebCore::Navigation::type):
(WebCore::Navigation::redirectCount):
* page/Navigation.h: Added.
(WebCore::Navigation::create):
* page/Navigation.idl: Added.
* page/NavigationTiming.cpp: Removed.
* page/NavigationTiming.h: Removed.
* page/NavigationTiming.idl: Removed.
* page/Performance.cpp:
(WebCore::Performance::navigation):
(WebCore::Performance::timing):
* page/Performance.h:
* page/Performance.idl:
* page/Timing.cpp: Added.
(WebCore::Timing::Timing):
(WebCore::Timing::frame):
(WebCore::Timing::disconnectFrame):
(WebCore::Timing::navigationStart):
* page/Timing.h: Added.
(WebCore::Timing::create):
* page/Timing.idl: Added.
2010-07-01 Daniel Cheng <dcheng@chromium.org>
Reviewed by Jian Li.
......@@ -201,7 +201,7 @@
#include "JSMouseEvent.cpp"
#include "JSMutationEvent.cpp"
#include "JSNamedNodeMap.cpp"
#include "JSNavigationTiming.cpp"
#include "JSNavigation.cpp"
#include "JSNavigator.cpp"
#include "JSNode.cpp"
#include "JSNodeFilter.cpp"
......@@ -383,6 +383,7 @@
#include "JSTextEvent.cpp"
#include "JSTextMetrics.cpp"
#include "JSTimeRanges.cpp"
#include "JSTiming.cpp"
#include "JSTouch.cpp"
#include "JSTouchEvent.cpp"
#include "JSTouchList.cpp"
......
......@@ -243,7 +243,7 @@ DOM_CLASSES = \
MouseEvent \
MutationEvent \
NamedNodeMap \
NavigationTiming \
Navigation \
Navigator \
Node \
NodeFilter \
......@@ -437,6 +437,7 @@ DOM_CLASSES = \
TextEvent \
TextMetrics \
TimeRanges \
Timing \
Touch \
TouchEvent \
TouchList \
......
......@@ -300,11 +300,12 @@ IDL_BINDINGS += \
WebCore/page/History.idl \
WebCore/page/Location.idl \
WebCore/page/MemoryInfo.idl \
WebCore/page/NavigationTiming.idl \
WebCore/page/Navigation.idl \
WebCore/page/Navigator.idl \
WebCore/page/Performance.idl \
WebCore/page/PositionError.idl \
WebCore/page/Screen.idl \
WebCore/page/Timing.idl \
WebCore/page/WebKitPoint.idl \
WebCore/page/WorkerNavigator.idl \
WebCore/plugins/MimeType.idl \
......@@ -1544,8 +1545,8 @@ webcore_sources += \
WebCore/page/MemoryInfo.h \
WebCore/page/MouseEventWithHitTestResults.cpp \
WebCore/page/MouseEventWithHitTestResults.h \
WebCore/page/NavigationTiming.cpp \
WebCore/page/NavigationTiming.h \
WebCore/page/Navigation.cpp \
WebCore/page/Navigation.h \
WebCore/page/Navigator.cpp \
WebCore/page/Navigator.h \
WebCore/page/NavigatorBase.cpp \
......@@ -1580,6 +1581,8 @@ webcore_sources += \
WebCore/page/SpatialNavigation.h \
WebCore/page/SuspendableTimer.cpp \
WebCore/page/SuspendableTimer.h \
WebCore/page/Timing.cpp \
WebCore/page/Timing.h \
WebCore/page/UserContentURLPattern.cpp \
WebCore/page/UserContentURLPattern.h \
WebCore/page/UserScript.h \
......
......@@ -216,11 +216,12 @@
'page/History.idl',
'page/Location.idl',
'page/MemoryInfo.idl',
'page/NavigationTiming.idl',
'page/Navigation.idl',
'page/Navigator.idl',
'page/Performance.idl',
'page/PositionError.idl',
'page/Screen.idl',
'page/Timing.idl',
'page/WebKitPoint.idl',
'page/WorkerNavigator.idl',
'plugins/MimeType.idl',
......@@ -1985,8 +1986,8 @@
'page/MemoryInfo.h',
'page/MouseEventWithHitTestResults.cpp',
'page/MouseEventWithHitTestResults.h',
'page/NavigationTiming.cpp',
'page/NavigationTiming.h',
'page/Navigation.cpp',
'page/Navigation.h',
'page/Navigator.cpp',
'page/Navigator.h',
'page/NavigatorBase.cpp',
......@@ -2021,6 +2022,8 @@
'page/SpatialNavigation.cpp',
'page/SuspendableTimer.cpp',
'page/SuspendableTimer.h',
'page/Timing.cpp',
'page/Timing.h',
'page/UserContentURLPattern.cpp',
'page/UserContentURLPattern.h',
'page/UserScript.h',
......
......@@ -456,11 +456,12 @@ IDL_BINDINGS += \
page/History.idl \
page/Location.idl \
page/MemoryInfo.idl \
page/NavigationTiming.idl \
page/Navigation.idl \
page/Navigator.idl \
page/Performance.idl \
page/PositionError.idl \
page/Screen.idl \
page/Timing.idl \
page/WebKitPoint.idl \
page/WorkerNavigator.idl \
plugins/Plugin.idl \
......
......@@ -806,7 +806,7 @@ SOURCES += \
page/DOMSelection.cpp \
page/DOMTimer.cpp \
page/DOMWindow.cpp \
page/NavigationTiming.cpp \
page/Navigation.cpp \
page/Navigator.cpp \
page/NavigatorBase.cpp \
page/DragController.cpp \
......@@ -835,6 +835,7 @@ SOURCES += \
page/Settings.cpp \
page/SpatialNavigation.cpp \
page/SuspendableTimer.cpp \
page/Timing.cpp \
page/UserContentURLPattern.cpp \
page/WindowFeatures.cpp \
page/XSSAuditor.cpp \
......
......@@ -9453,7 +9453,7 @@
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNavigationTiming.cpp"
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNavigation.cpp"
>
<FileConfiguration
Name="Debug|Win32"
......@@ -9505,7 +9505,7 @@
</FileConfiguration>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNavigationTiming.h"
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNavigation.h"
>
</File>
<File
......@@ -19148,6 +19148,62 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSTimeRanges.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSTiming.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Internal|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_All|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSTiming.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSTreeWalker.cpp"
>
......@@ -22273,11 +22329,11 @@
>
</File>
<File
RelativePath="..\page\NavigationTiming.cpp"
RelativePath="..\page\Navigation.cpp"
>
</File>
<File
RelativePath="..\page\NavigationTiming.h"
RelativePath="..\page\Navigation.h"
>
</File>
<File
......@@ -22412,6 +22468,14 @@
RelativePath="..\page\SuspendableTimer.h"
>
</File>
<File
RelativePath="..\page\Timing.cpp"
>
</File>
<File
RelativePath="..\page\Timing.h"
>
</File>
<File
RelativePath="..\page\UserContentURLPattern.cpp"
>
......@@ -2304,6 +2304,10 @@
8A844CFF11D3C17C0014065C /* NavigationTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A844CFC11D3C17C0014065C /* NavigationTiming.h */; };
8A844D0411D3C18E0014065C /* Performance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A844D0111D3C18E0014065C /* Performance.cpp */; };
8A844D0511D3C18E0014065C /* Performance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A844D0211D3C18E0014065C /* Performance.h */; };
8AF4E55511DC5A36000ED3DE /* Navigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55211DC5A36000ED3DE /* Navigation.cpp */; };
8AF4E55611DC5A36000ED3DE /* Navigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF4E55311DC5A36000ED3DE /* Navigation.h */; };
8AF4E55B11DC5A63000ED3DE /* Timing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55811DC5A63000ED3DE /* Timing.cpp */; };
8AF4E55C11DC5A63000ED3DE /* Timing.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF4E55911DC5A63000ED3DE /* Timing.h */; };
8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */; };
9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -7980,6 +7984,12 @@
8A844D0111D3C18E0014065C /* Performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Performance.cpp; sourceTree = "<group>"; };
8A844D0211D3C18E0014065C /* Performance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Performance.h; sourceTree = "<group>"; };
8A844D0311D3C18E0014065C /* Performance.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Performance.idl; sourceTree = "<group>"; };
8AF4E55211DC5A36000ED3DE /* Navigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Navigation.cpp; sourceTree = "<group>"; };
8AF4E55311DC5A36000ED3DE /* Navigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Navigation.h; sourceTree = "<group>"; };
8AF4E55411DC5A36000ED3DE /* Navigation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Navigation.idl; sourceTree = "<group>"; };
8AF4E55811DC5A63000ED3DE /* Timing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timing.cpp; sourceTree = "<group>"; };
8AF4E55911DC5A63000ED3DE /* Timing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timing.h; sourceTree = "<group>"; };
8AF4E55A11DC5A63000ED3DE /* Timing.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Timing.idl; sourceTree = "<group>"; };
8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecState.h; sourceTree = "<group>"; };
8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMainThreadExecState.cpp; sourceTree = "<group>"; };
9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
......@@ -12231,9 +12241,9 @@
9FFE3E7C11B59C6E0037874E /* MemoryInfo.idl */,
93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */,
935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */,
8A844CFB11D3C17C0014065C /* NavigationTiming.cpp */,
8A844CFC11D3C17C0014065C /* NavigationTiming.h */,
8A844CFD11D3C17C0014065C /* NavigationTiming.idl */,
8AF4E55211DC5A36000ED3DE /* Navigation.cpp */,
8AF4E55311DC5A36000ED3DE /* Navigation.h */,
8AF4E55411DC5A36000ED3DE /* Navigation.idl */,
A9C6E5A30D746458006442E9 /* Navigator.cpp */,
A9C6E5A40D746458006442E9 /* Navigator.h */,
A9C6E65D0D746694006442E9 /* Navigator.idl */,
......@@ -12272,6 +12282,9 @@
626CDE0D1140424C001E5A68 /* SpatialNavigation.h */,
62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
8AF4E55811DC5A63000ED3DE /* Timing.cpp */,
8AF4E55911DC5A63000ED3DE /* Timing.h */,
8AF4E55A11DC5A63000ED3DE /* Timing.idl */,
BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */,
BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */,
BCA2B0601050475F0043BD1C /* UserScript.h */,
......@@ -18891,7 +18904,6 @@
A818721E0977D3C0005826D9 /* NameNodeList.h in Headers */,
E10B9B6C0B747599003ED890 /* NativeXPathNSResolver.h in Headers */,
93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */,
8A844CFF11D3C17C0014065C /* NavigationTiming.h in Headers */,
A9C6E5A60D746458006442E9 /* Navigator.h in Headers */,
E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */,
656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */,
......@@ -19684,6 +19696,8 @@
A8A563B411DB3D10003AC2F0 /* HTMLElementStack.h in Headers */,
A8A564A511DC0E59003AC2F0 /* HTMLFormattingElementList.h in Headers */,
8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */,
8AF4E55611DC5A36000ED3DE /* Navigation.h in Headers */,
8AF4E55C11DC5A63000ED3DE /* Timing.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -21330,7 +21344,6 @@
A81872240977D3C0005826D9 /* NameNodeList.cpp in Sources */,
E10B9B6D0B747599003ED890 /* NativeXPathNSResolver.cpp in Sources */,
93CCF0600AF6CA7600018E89 /* NavigationAction.cpp in Sources */,
8A844CFE11D3C17C0014065C /* NavigationTiming.cpp in Sources */,
A9C6E5A50D746458006442E9 /* Navigator.cpp in Sources */,
E12719CA0EEEC21300F61213 /* NavigatorBase.cpp in Sources */,
5D874F130D161D3200796C3B /* NetscapePlugInStreamLoader.cpp in Sources */,
......@@ -22022,6 +22035,8 @@
BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
A8A563B511DB3D10003AC2F0 /* HTMLElementStack.cpp in Sources */,
A8A564A611DC0E59003AC2F0 /* HTMLFormattingElementList.cpp in Sources */,
8AF4E55511DC5A36000ED3DE /* Navigation.cpp in Sources */,
8AF4E55B11DC5A63000ED3DE /* Timing.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "Navigation.h"
#if ENABLE(WEB_TIMING)
#include "Frame.h"
namespace WebCore {
Navigation::Navigation(Frame* frame)
: m_frame(frame)
{
}
Frame* Navigation::frame() const
{
return m_frame;
}
void Navigation::disconnectFrame()
{
m_frame = 0;
}
unsigned short Navigation::type() const
{
if (!m_frame)
return 0;
return 0; // FIXME
}
unsigned short Navigation::redirectCount() const
{
if (!m_frame)
return 0;
return 0; // FIXME
}
} // namespace WebCore
#endif // ENABLE(WEB_TIMING)
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef Navigation_h
#define Navigation_h
#if ENABLE(WEB_TIMING)
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
class Frame;
class Navigation : public RefCounted<Navigation> {
public:
static PassRefPtr<Navigation> create(Frame* frame) { return adoptRef(new Navigation(frame)); }
Frame* frame() const;
void disconnectFrame();
unsigned short type() const;
unsigned short redirectCount() const;
private:
Navigation(Frame*);
Frame* m_frame;
};
}
#endif // !ENABLE(WEB_TIMING)
#endif // !defined(Navigation_h)
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module window {
// See: http://dev.w3.org/2006/webapi/WebTiming/
interface [Conditional=WEB_TIMING, OmitConstructor] Navigation {
const unsigned short NAVIGATION_OTHER = 0;
const unsigned short NAVIGATION_LINK = 1;
const unsigned short NAVIGATION_FORWARD_BACK = 2;
const unsigned short NAVIGATION_BROWSER = 3;
const unsigned short NAVIGATION_NEW_WINDOW = 4;
const unsigned short NAVIGATION_RELOAD = 5;
const unsigned short NAVIGATION_FRAME = 6;
readonly attribute unsigned short type;
readonly attribute unsigned short redirectCount;
};
}
......@@ -31,7 +31,8 @@
#include "config.h"
#include "Performance.h"
#include "NavigationTiming.h"
#include "Navigation.h"
#include "Timing.h"
#if ENABLE(WEB_TIMING)
......@@ -54,12 +55,20 @@ void Performance::disconnectFrame()
m_frame = 0;
}
NavigationTiming* Performance::timing() const
Navigation* Performance::navigation() const
{
if (!m_navigationTiming)
m_navigationTiming = NavigationTiming::create(m_frame);
if (!m_navigation)
m_navigation = Navigation::create(m_frame);
return m_navigationTiming.get();
return m_navigation.get();
}
Timing* Performance::timing() const
{
if (!m_timing)
m_timing = Timing::create(m_frame);
return m_timing.get();
}
} // namespace WebCore
......
......@@ -33,7 +33,8 @@
#if ENABLE(WEB_TIMING)
#include "NavigationTiming.h"
#include "Navigation.h"
#include "Timing.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
......@@ -47,12 +48,14 @@ public:
Frame* frame() const;
void disconnectFrame();
NavigationTiming* timing() const;
Navigation*