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..9e314c750fd8607e149d0ad9c3d12fc46d05a531 100644 |
| --- a/content/renderer/stats_collection_controller.h |
| +++ b/components/html_viewer/stats_collection_controller.h |
| @@ -1,18 +1,24 @@ |
| -// 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 "components/html_viewer/stats_collection_observer.h" |
| #include "gin/wrappable.h" |
| +#include "mojo/services/tracing/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 +29,16 @@ class StatsCollectionController |
| public: |
| static gin::WrapperInfo kWrapperInfo; |
| - static void Install(blink::WebFrame* frame); |
| + static StatsCollectionController* Install(HTMLDocument* html_document, |
|
sky
2015/08/12 23:54:36
Can you make this take WebFrame, which would work
yzshen1
2015/08/13 15:59:12
Please comment about the lifespan and ownership of
msw
2015/08/14 23:20:35
Done.
msw
2015/08/14 23:20:35
Done.
|
| + mojo::ApplicationImpl* app); |
| + |
| + // Record timing for various blink::WebFrameClient events. |
| + void DidHandleOnloadEvents(const base::Time& time); |
| + void DidFirstVisuallyNonEmptyLayout(const base::Time& time); |
| private: |
| - StatsCollectionController(); |
| + StatsCollectionController(HTMLDocument* html_document, |
| + mojo::ApplicationImpl* app); |
| ~StatsCollectionController() override; |
| // gin::WrappableBase |
| @@ -36,16 +48,18 @@ 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(); |
| + StatsCollectionObserver observer_; |
|
yzshen1
2015/08/13 15:59:12
Maybe consider merging the observer into this clas
msw
2015/08/14 23:20:34
Removed.
|
| + tracing::StartupPerformanceControllerPtr startup_performance_controller_; |
| + |
| 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_ |