From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/navigate.c | 23 ++++++++++++++++------- dlls/mshtml/omnavigator.c | 8 ++++---- dlls/mshtml/tests/documentmode.js | 2 ++ 4 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 59439823817..61b22306d43 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -602,6 +602,8 @@ struct HTMLInnerWindow { ULONGLONG dns_lookup_time; ULONGLONG connect_time; ULONGLONG request_time; + ULONGLONG response_start_time; + ULONGLONG response_end_time; };
#define NO_PERFORMANCE_OBJ ((IHTMLPerformance*)IntToPtr(-1)) diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 6ca2fbe1dcb..c5a9cfd1263 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -1107,6 +1107,9 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) if(!This->response_processed) { IWinInetHttpInfo *wininet_info;
+ if(This->is_doc_channel) + This->bsc.window->response_start_time = get_time_stamp(); + This->response_processed = TRUE; if(This->bsc.binding) { hres = IBinding_QueryInterface(This->bsc.binding, &IID_IWinInetHttpInfo, (void**)&wininet_info); @@ -1522,13 +1525,16 @@ static HRESULT nsChannelBSC_stop_binding(BSCallback *bsc, HRESULT result) { nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc);
- if(result != E_ABORT && This->is_doc_channel && This->bsc.window) { - if(FAILED(result)) - handle_navigation_error(This, result); - else if(This->nschannel) { - result = async_stop_request(This); - if(SUCCEEDED(result)) - return S_OK; + if(This->is_doc_channel && This->bsc.window) { + This->bsc.window->response_end_time = get_time_stamp(); + if(result != E_ABORT) { + if(FAILED(result)) + handle_navigation_error(This, result); + else if(This->nschannel) { + result = async_stop_request(This); + if(SUCCEEDED(result)) + return S_OK; + } } }
@@ -1786,6 +1792,9 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code, char *str; HRESULT hres;
+ if(This->is_doc_channel) + This->bsc.window->response_start_time = get_time_stamp(); + This->response_processed = TRUE; This->nschannel->response_status = response_code;
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 5b3f54c2d05..65a31fa41db 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1733,9 +1733,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_responseStart(IHTMLPerformanceTi { HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
- FIXME("(%p)->(%p) returning fake value\n", This, p); + TRACE("(%p)->(%p)\n", This, p);
- *p = TIMING_FAKE_TIMESTAMP; + *p = This->window->response_start_time; return S_OK; }
@@ -1743,9 +1743,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_responseEnd(IHTMLPerformanceTimi { HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
- FIXME("(%p)->(%p) returning fake value\n", This, p); + TRACE("(%p)->(%p)\n", This, p);
- *p = TIMING_FAKE_TIMESTAMP; + *p = This->window->response_end_time; return S_OK; }
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index e933ea0ff54..881a08e9a54 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -26,6 +26,8 @@ ok(performance.timing.domainLookupEnd >= performance.timing.domainLookupStart, " ok(performance.timing.connectStart >= performance.timing.domainLookupEnd, "connectStart < domainLookupEnd"); ok(performance.timing.connectEnd >= performance.timing.connectStart, "connectEnd < connectStart"); ok(performance.timing.requestStart >= performance.timing.connectEnd, "requestStart < connectEnd"); +ok(performance.timing.responseStart >= performance.timing.requestStart, "responseStart < requestStart"); +ok(performance.timing.responseEnd >= performance.timing.responseStart, "responseEnd < responseStart"); ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0");