| 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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 gin::WrapperInfo StatsCollectionController::kWrapperInfo = { | 76 gin::WrapperInfo StatsCollectionController::kWrapperInfo = { |
| 77 gin::kEmbedderNativeGin | 77 gin::kEmbedderNativeGin |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 // static | 80 // static |
| 81 void StatsCollectionController::Install(blink::WebFrame* frame) { | 81 void StatsCollectionController::Install(blink::WebLocalFrame* frame) { |
| 82 v8::Isolate* isolate = blink::MainThreadIsolate(); | 82 v8::Isolate* isolate = blink::MainThreadIsolate(); |
| 83 v8::HandleScope handle_scope(isolate); | 83 v8::HandleScope handle_scope(isolate); |
| 84 v8::Local<v8::Context> context = frame->MainWorldScriptContext(); | 84 v8::Local<v8::Context> context = frame->MainWorldScriptContext(); |
| 85 if (context.IsEmpty()) | 85 if (context.IsEmpty()) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 v8::Context::Scope context_scope(context); | 88 v8::Context::Scope context_scope(context); |
| 89 | 89 |
| 90 gin::Handle<StatsCollectionController> controller = | 90 gin::Handle<StatsCollectionController> controller = |
| 91 gin::CreateHandle(isolate, new StatsCollectionController()); | 91 gin::CreateHandle(isolate, new StatsCollectionController()); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 std::string tab_timing_json; | 154 std::string tab_timing_json; |
| 155 ConvertLoadTimeToJSON( | 155 ConvertLoadTimeToJSON( |
| 156 observer->load_start_time(), observer->load_stop_time(), | 156 observer->load_start_time(), observer->load_stop_time(), |
| 157 &tab_timing_json); | 157 &tab_timing_json); |
| 158 return tab_timing_json; | 158 return tab_timing_json; |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace content | 161 } // namespace content |
| OLD | NEW |