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

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

Issue 2923053002: Move MainWorldScriptContext accessor/method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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
« no previous file with comments | « content/renderer/stats_collection_controller.h ('k') | content/renderer/web_ui_extension.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « content/renderer/stats_collection_controller.h ('k') | content/renderer/web_ui_extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698