Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 339573003: NavigationTiming: set navigationStart for navigations in new tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK that browser_navigation_start is always present. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 data = reinterpret_cast<const char*>( 877 data = reinterpret_cast<const char*>(
878 &params.browser_initiated_post_data.front()); 878 &params.browser_initiated_post_data.front());
879 } 879 }
880 http_body.appendData( 880 http_body.appendData(
881 WebData(data, params.browser_initiated_post_data.size())); 881 WebData(data, params.browser_initiated_post_data.size()));
882 request.setHTTPBody(http_body); 882 request.setHTTPBody(http_body);
883 } 883 }
884 884
885 frame->loadRequest(request); 885 frame->loadRequest(request);
886 886
887 // If this is a cross-process navigation, the browser process will send 887 // The browser provides the navigation_start time to bootstrap the
888 // along the proper navigation start value. 888 // Navigation Timing information for the browser-initiated navigations. In
889 if (!params.browser_navigation_start.is_null() && 889 // case of cross-process navigations, this carries over the time of
890 frame->provisionalDataSource()) { 890 // finishing the onbeforeunload handler of the previous page.
891 DCHECK(!params.browser_navigation_start.is_null());
892 if (frame->provisionalDataSource()) {
891 // browser_navigation_start is likely before this process existed, so we 893 // browser_navigation_start is likely before this process existed, so we
892 // can't use InterProcessTimeTicksConverter. Instead, the best we can do 894 // can't use InterProcessTimeTicksConverter. Instead, the best we can do
893 // is just ensure we don't report a bogus value in the future. 895 // is just ensure we don't report a bogus value in the future.
894 base::TimeTicks navigation_start = std::min( 896 base::TimeTicks navigation_start = std::min(
895 base::TimeTicks::Now(), params.browser_navigation_start); 897 base::TimeTicks::Now(), params.browser_navigation_start);
896 double navigation_start_seconds = 898 double navigation_start_seconds =
897 (navigation_start - base::TimeTicks()).InSecondsF(); 899 (navigation_start - base::TimeTicks()).InSecondsF();
898 frame->provisionalDataSource()->setNavigationStartTime( 900 frame->provisionalDataSource()->setNavigationStartTime(
899 navigation_start_seconds); 901 navigation_start_seconds);
900 } 902 }
(...skipping 2663 matching lines...) Expand 10 before | Expand all | Expand 10 after
3564 3566
3565 #if defined(ENABLE_BROWSER_CDMS) 3567 #if defined(ENABLE_BROWSER_CDMS)
3566 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3568 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3567 if (!cdm_manager_) 3569 if (!cdm_manager_)
3568 cdm_manager_ = new RendererCdmManager(this); 3570 cdm_manager_ = new RendererCdmManager(this);
3569 return cdm_manager_; 3571 return cdm_manager_;
3570 } 3572 }
3571 #endif // defined(ENABLE_BROWSER_CDMS) 3573 #endif // defined(ENABLE_BROWSER_CDMS)
3572 3574
3573 } // namespace content 3575 } // namespace content
OLDNEW
« content/common/frame_messages.h ('K') | « content/common/frame_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698