| OLD | NEW |
| 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 data = reinterpret_cast<const char*>( | 879 data = reinterpret_cast<const char*>( |
| 880 ¶ms.browser_initiated_post_data.front()); | 880 ¶ms.browser_initiated_post_data.front()); |
| 881 } | 881 } |
| 882 http_body.appendData( | 882 http_body.appendData( |
| 883 WebData(data, params.browser_initiated_post_data.size())); | 883 WebData(data, params.browser_initiated_post_data.size())); |
| 884 request.setHTTPBody(http_body); | 884 request.setHTTPBody(http_body); |
| 885 } | 885 } |
| 886 | 886 |
| 887 frame->loadRequest(request); | 887 frame->loadRequest(request); |
| 888 | 888 |
| 889 // If this is a cross-process navigation, the browser process will send | 889 // The browser provides the navigation_start time to bootstrap the |
| 890 // along the proper navigation start value. | 890 // Navigation Timing information for the browser-initiated navigations. In |
| 891 if (!params.browser_navigation_start.is_null() && | 891 // case of cross-process navigations, this carries over the time of |
| 892 frame->provisionalDataSource()) { | 892 // finishing the onbeforeunload handler of the previous page. |
| 893 DCHECK(!params.browser_navigation_start.is_null()); |
| 894 if (frame->provisionalDataSource()) { |
| 893 // browser_navigation_start is likely before this process existed, so we | 895 // browser_navigation_start is likely before this process existed, so we |
| 894 // can't use InterProcessTimeTicksConverter. Instead, the best we can do | 896 // can't use InterProcessTimeTicksConverter. Instead, the best we can do |
| 895 // is just ensure we don't report a bogus value in the future. | 897 // is just ensure we don't report a bogus value in the future. |
| 896 base::TimeTicks navigation_start = std::min( | 898 base::TimeTicks navigation_start = std::min( |
| 897 base::TimeTicks::Now(), params.browser_navigation_start); | 899 base::TimeTicks::Now(), params.browser_navigation_start); |
| 898 double navigation_start_seconds = | 900 double navigation_start_seconds = |
| 899 (navigation_start - base::TimeTicks()).InSecondsF(); | 901 (navigation_start - base::TimeTicks()).InSecondsF(); |
| 900 frame->provisionalDataSource()->setNavigationStartTime( | 902 frame->provisionalDataSource()->setNavigationStartTime( |
| 901 navigation_start_seconds); | 903 navigation_start_seconds); |
| 902 } | 904 } |
| (...skipping 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3571 | 3573 |
| 3572 #if defined(ENABLE_BROWSER_CDMS) | 3574 #if defined(ENABLE_BROWSER_CDMS) |
| 3573 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3575 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 3574 if (!cdm_manager_) | 3576 if (!cdm_manager_) |
| 3575 cdm_manager_ = new RendererCdmManager(this); | 3577 cdm_manager_ = new RendererCdmManager(this); |
| 3576 return cdm_manager_; | 3578 return cdm_manager_; |
| 3577 } | 3579 } |
| 3578 #endif // defined(ENABLE_BROWSER_CDMS) | 3580 #endif // defined(ENABLE_BROWSER_CDMS) |
| 3579 | 3581 |
| 3580 } // namespace content | 3582 } // namespace content |
| OLD | NEW |