| 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/stats_collection_controller.h" | 5 #include "content/renderer/stats_collection_controller.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "content/common/child_process_messages.h" | 11 #include "content/common/child_process_messages.h" |
| 12 #include "content/renderer/render_view_impl.h" | 12 #include "content/renderer/render_view_impl.h" |
| 13 #include "gin/handle.h" | 13 #include "gin/handle.h" |
| 14 #include "gin/object_template_builder.h" | 14 #include "gin/object_template_builder.h" |
| 15 #include "third_party/WebKit/public/web/WebFrame.h" | |
| 16 #include "third_party/WebKit/public/web/WebKit.h" | 15 #include "third_party/WebKit/public/web/WebKit.h" |
| 16 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 17 #include "third_party/WebKit/public/web/WebView.h" | 17 #include "third_party/WebKit/public/web/WebView.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 bool CurrentRenderViewImpl(RenderViewImpl** out) { | 23 bool CurrentRenderViewImpl(RenderViewImpl** out) { |
| 24 blink::WebFrame* web_frame = blink::WebFrame::frameForCurrentContext(); | 24 blink::WebLocalFrame* web_frame = |
| 25 blink::WebLocalFrame::frameForCurrentContext(); |
| 25 if (!web_frame) | 26 if (!web_frame) |
| 26 return false; | 27 return false; |
| 27 | 28 |
| 28 blink::WebView* web_view = web_frame->view(); | 29 blink::WebView* web_view = web_frame->view(); |
| 29 if (!web_view) | 30 if (!web_view) |
| 30 return false; | 31 return false; |
| 31 | 32 |
| 32 RenderViewImpl* render_view_impl = | 33 RenderViewImpl* render_view_impl = |
| 33 RenderViewImpl::FromWebView(web_view); | 34 RenderViewImpl::FromWebView(web_view); |
| 34 if (!render_view_impl) | 35 if (!render_view_impl) |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 148 } |
| 148 | 149 |
| 149 std::string tab_timing_json; | 150 std::string tab_timing_json; |
| 150 ConvertLoadTimeToJSON( | 151 ConvertLoadTimeToJSON( |
| 151 observer->load_start_time(), observer->load_stop_time(), | 152 observer->load_start_time(), observer->load_stop_time(), |
| 152 &tab_timing_json); | 153 &tab_timing_json); |
| 153 return tab_timing_json; | 154 return tab_timing_json; |
| 154 } | 155 } |
| 155 | 156 |
| 156 } // namespace content | 157 } // namespace content |
| OLD | NEW |