diff options
Diffstat (limited to 'chromium/chrome/browser/ui/webui/discards/discards.mojom')
-rw-r--r-- | chromium/chrome/browser/ui/webui/discards/discards.mojom | 81 |
1 files changed, 76 insertions, 5 deletions
diff --git a/chromium/chrome/browser/ui/webui/discards/discards.mojom b/chromium/chrome/browser/ui/webui/discards/discards.mojom index 61d5f81d1cc..ca07b071130 100644 --- a/chromium/chrome/browser/ui/webui/discards/discards.mojom +++ b/chromium/chrome/browser/ui/webui/discards/discards.mojom @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojom; +module discards.mojom; import "chrome/browser/resource_coordinator/lifecycle_unit_state.mojom"; +import "mojo/public/mojom/base/process_id.mojom"; import "mojo/public/mojom/base/time.mojom"; +import "url/mojom/url.mojom"; // Identical to content::Visibility. enum LifecycleUnitVisibility { @@ -91,9 +93,9 @@ struct TabDiscardsInfo { // The visibility of the LifecycleUnit. LifecycleUnitVisibility visibility; // The loading state of the LifecycleUnit. - LifecycleUnitLoadingState loading_state; + mojom.LifecycleUnitLoadingState loading_state; // The state of the LifecycleUnit. - LifecycleUnitState state; + mojom.LifecycleUnitState state; // Whether the tab can be frozen. bool can_freeze; // List of human-readable reasons why a tab can't be frozen. @@ -106,7 +108,7 @@ struct TabDiscardsInfo { // session. int32 discard_count; // If the tab is currently discarded, the discard reason. - LifecycleUnitDiscardReason discard_reason; + mojom.LifecycleUnitDiscardReason discard_reason; // The rank of the tab in the "importance to user" list. The tab with 1 is the // most important, the tab with N is the least important. int32 utility_rank; @@ -135,7 +137,7 @@ struct TabDiscardsInfo { // Interface for providing information about discards. Lives in the browser // process and is invoked in the renderer process via Javascript code running in // the chrome://discards WebUI. -interface DiscardsDetailsProvider { +interface DetailsProvider { // Returns an array of TabDiscardsInfo containing discard information about // each tab currently open in the browser, across all profiles. GetTabDiscardsInfo() => (array<TabDiscardsInfo> infos); @@ -177,3 +179,72 @@ interface DiscardsDetailsProvider { // if the decision was made not to discard. Discard(bool urgent) => (); }; + +// Represents the momentary state of a Page CU. +struct PageInfo { + int64 id; + + url.mojom.Url main_frame_url; + + // TODO(siggi): Estimate data. +}; + +// Represents the momentary state of a Frame CU. +struct FrameInfo { + int64 id; + + url.mojom.Url url; + int64 page_id; + int64 parent_frame_id; + int64 process_id; +}; + +// Represents the momentary state of a Process CU. +struct ProcessInfo { + int64 id; + + mojo_base.mojom.ProcessId pid; + mojo_base.mojom.TimeDelta cumulative_cpu_usage; + uint64 private_footprint_kb; +}; + +// Used to transport favicon data. +struct FavIconInfo { + int64 node_id; + + // Contains the base64-encoded icon data, suitable for inclusion in a + // data URL. + string icon_data; +}; + +// Implement to receive a stream of notifications when performance manager +// graph nodes are created, changed or deleted. +interface GraphChangeStream { + // The |frame| was created. + FrameCreated(FrameInfo frame); + // The |page| was created. + PageCreated(PageInfo pages); + // The |process| was created. + ProcessCreated(ProcessInfo process); + + // The |frame| changed. + FrameChanged(FrameInfo frame); + // The |page| changed. + PageChanged(PageInfo page); + // The |process| changed. + ProcessChanged(ProcessInfo process); + + // A |favicon| became available, whether because the associated page changed + // its favicon, or because an initial lookup completed. + FavIconDataAvailable(FavIconInfo favicon); + + // The node with |node_id| was deleted. + NodeDeleted(int64 node_id); +}; + +// This interface allows subscribing to a stream of events that track the state +// of the performance manager graph. +interface GraphDump { + // Subscribes |change_subscriber| to a graph change stream. + SubscribeToChanges(pending_remote<GraphChangeStream> change_subscriber); +}; |