Chromium Code Reviews| Index: components/html_viewer/stats_collection_controller.h |
| diff --git a/content/renderer/stats_collection_controller.h b/components/html_viewer/stats_collection_controller.h |
| similarity index 51% |
| copy from content/renderer/stats_collection_controller.h |
| copy to components/html_viewer/stats_collection_controller.h |
| index c36349c51a2dfdaf43297c3838ac7fac5dc5abf9..0aa0a19b3abc0a5a6c2482c85f55da6830be5936 100644 |
| --- a/content/renderer/stats_collection_controller.h |
| +++ b/components/html_viewer/stats_collection_controller.h |
| @@ -1,18 +1,23 @@ |
| -// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_ |
| -#define CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_ |
| +#ifndef COMPONENTS_HTML_VIEWER_STATS_COLLECTION_CONTROLLER_H_ |
| +#define COMPONENTS_HTML_VIEWER_STATS_COLLECTION_CONTROLLER_H_ |
| #include "base/basictypes.h" |
| #include "gin/wrappable.h" |
| +#include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
| namespace blink { |
| class WebFrame; |
| } |
| -namespace content { |
| +namespace mojo { |
| +class ApplicationImpl; |
| +} |
| + |
| +namespace html_viewer { |
| // This class is exposed in JS as window.statsCollectionController and provides |
| // functionality to read out statistics from the browser. |
| @@ -23,10 +28,15 @@ class StatsCollectionController |
| public: |
| static gin::WrapperInfo kWrapperInfo; |
| - static void Install(blink::WebFrame* frame); |
| + // Install the JS and return a mojo:tracing InterfacePtr for stats reporting. |
| + // This bails and returns an invalid pointer without the command line flag. |
|
sky
2015/08/17 20:09:30
'invalid pointer' makes it sounds like the pointer
msw
2015/08/17 21:25:50
Done.
|
| + static tracing::StartupPerformanceDataCollectorPtr Install( |
| + blink::WebFrame* frame, |
| + mojo::ApplicationImpl* app); |
| private: |
| - StatsCollectionController(); |
| + explicit StatsCollectionController( |
| + tracing::StartupPerformanceDataCollectorPtr collector); |
| ~StatsCollectionController() override; |
| // gin::WrappableBase |
| @@ -36,16 +46,15 @@ class StatsCollectionController |
| // Retrieves a histogram and returns a JSON representation of it. |
| std::string GetHistogram(const std::string& histogram_name); |
| - // Retrieves a histogram from the browser process and returns a JSON |
| - // representation of it. |
| + // Retrieves a browser histogram and returns a JSON representation of it. |
| std::string GetBrowserHistogram(const std::string& histogram_name); |
| - // Returns JSON representation of tab timing information for the current tab. |
| - std::string GetTabLoadTiming(); |
| + tracing::StartupPerformanceDataCollectorPtr |
| + startup_performance_data_collector_; |
| DISALLOW_COPY_AND_ASSIGN(StatsCollectionController); |
| }; |
| -} // namespace content |
| +} // namespace html_viewer |
| -#endif // CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_ |
| +#endif // COMPONENTS_HTML_VIEWER_STATS_COLLECTION_CONTROLLER_H_ |