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

Unified Diff: content/renderer/stats_collection_controller.cc

Issue 118423004: Add support for wrapping classes indirectly inherited from gin::Wrappable<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update StatsCollectionController Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/stats_collection_controller.h ('k') | gin/wrappable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/stats_collection_controller.cc
diff --git a/content/renderer/stats_collection_controller.cc b/content/renderer/stats_collection_controller.cc
index 0f5230e72d1391cc4f254d5b68cb424d30618b40..cbbdc403698fa00551cd1950729636ef52681e81 100644
--- a/content/renderer/stats_collection_controller.cc
+++ b/content/renderer/stats_collection_controller.cc
@@ -75,17 +75,6 @@ gin::WrapperInfo StatsCollectionController::kWrapperInfo = {
};
// static
-v8::Local<v8::ObjectTemplate> StatsCollectionController::GetObjectTemplate(
- v8::Isolate* isolate) {
- return gin::ObjectTemplateBuilder(isolate)
- .SetMethod("getHistogram", &StatsCollectionController::GetHistogram)
- .SetMethod("getBrowserHistogram",
- &StatsCollectionController::GetBrowserHistogram)
- .SetMethod("tabLoadTiming", &StatsCollectionController::GetTabLoadTiming)
- .Build();
-}
-
-// static
void StatsCollectionController::Install(blink::WebFrame* frame) {
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
@@ -106,6 +95,16 @@ StatsCollectionController::StatsCollectionController() {}
StatsCollectionController::~StatsCollectionController() {}
+gin::ObjectTemplateBuilder StatsCollectionController::GetObjectTemplateBuilder(
+ v8::Isolate* isolate) {
+ return gin::Wrappable<StatsCollectionController>::GetObjectTemplateBuilder(
+ isolate)
+ .SetMethod("getHistogram", &StatsCollectionController::GetHistogram)
+ .SetMethod("getBrowserHistogram",
+ &StatsCollectionController::GetBrowserHistogram)
+ .SetMethod("tabLoadTiming", &StatsCollectionController::GetTabLoadTiming);
+}
+
std::string StatsCollectionController::GetHistogram(
const std::string& histogram_name) {
base::HistogramBase* histogram =
« no previous file with comments | « content/renderer/stats_collection_controller.h ('k') | gin/wrappable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698