Skip to content

Commit

Permalink
Move time.mojom from common to base
Browse files Browse the repository at this point in the history
This change moves time.mojom from //mojo/common to //mojo/public/mojom/base.
Corresponding typemap and struct traits file were also moved. Unit tests for
Time, TimeDelta and TimeTicks were updated to use SerializeAndDeserialize() from
//mojo/public/cpp/test_support/test_utils.h and moved to mojo_unittests.

Bug: 799482,806965
Cq-Include-Trybots: luci.chromium.try:linux_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_mojo;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I080ca0628167a1be705f923a329b7e0986536b83
Reviewed-on: https://chromium-review.googlesource.com/962872
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Martin Barbella <mbarbella@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544277}
  • Loading branch information
Oksana Zhuravlova authored and Commit Bot committed Mar 20, 2018
1 parent 120a106 commit 57e8dca
Show file tree
Hide file tree
Showing 144 changed files with 478 additions and 463 deletions.
4 changes: 2 additions & 2 deletions ash/public/interfaces/accessibility_controller.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module ash.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";
import "ui/accessibility/ax_enums.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";

Expand Down Expand Up @@ -71,7 +71,7 @@ interface AccessibilityControllerClient {

// Initiates play of shutdown sound and returns sound duration. This method
// exists because the browser owns all media playback.
PlayShutdownSound() => (mojo.common.mojom.TimeDelta sound_duration);
PlayShutdownSound() => (mojo_base.mojom.TimeDelta sound_duration);

// Forwards an accessibility gesture from the touch exploration controller to
// ChromeVox.
Expand Down
4 changes: 2 additions & 2 deletions ash/public/interfaces/process_creation_time_recorder.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

module ash.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";

interface ProcessCreationTimeRecorder {
// Sets the time the main process was created at, used for logging metrics.
SetMainProcessCreationTime(mojo.common.mojom.TimeTicks start_time);
SetMainProcessCreationTime(mojo_base.mojom.TimeTicks start_time);
};
6 changes: 3 additions & 3 deletions ash/public/interfaces/session_controller.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module ash.mojom;

import "ash/public/interfaces/user_info.mojom";
import "components/signin/public/interfaces/account_id.mojom";
import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";

// Matches session_manager::SessionState.
enum SessionState {
Expand Down Expand Up @@ -158,8 +158,8 @@ interface SessionController {
// NOTE: Chrome enforces the limit, not ash. Ash could enforce it if local
// state prefs and user activity monitoring were available under mustash.
// http://crbug.com/729808
SetSessionLengthLimit(mojo.common.mojom.TimeDelta length_limit,
mojo.common.mojom.TimeTicks start_time);
SetSessionLengthLimit(mojo_base.mojom.TimeDelta length_limit,
mojo_base.mojom.TimeTicks start_time);

// Returns whether it's ok to switch the active multiprofile user. May affect
// or be affected by system state such as window overview mode and screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

module ash.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";

// Used to test internal state of TimeToFirstPresentRecorder.
interface TimeToFirstPresentRecorderTestApi {
// Returns the time between process creation and the first pixels shown on
// screen.
GetProcessCreationToFirstPresentTime() => (mojo.common.mojom.TimeDelta delta);
GetProcessCreationToFirstPresentTime() => (mojo_base.mojom.TimeDelta delta);
};
4 changes: 2 additions & 2 deletions ash/public/interfaces/vpn_list.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module ash.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";

// Describes a third-party VPN provided by an extension (e.g. Cisco AnyConnect).
struct ThirdPartyVpnProvider {
Expand All @@ -22,7 +22,7 @@ struct ArcVpnProvider {
// Unique app id for launching the app. e.g. pbmkokpdlpfmapoiccpblbmjjhhabjaa
string app_id;
// Last launch time of the Arc VPN provider.
mojo.common.mojom.Time last_launch_time;
mojo_base.mojom.Time last_launch_time;
};

// Manages the VPN provider list in ash. Allows extension-backed VPN providers
Expand Down
4 changes: 2 additions & 2 deletions ash/public/interfaces/wallpaper.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module ash.mojom;

import "ash/public/interfaces/user_info.mojom";
import "components/signin/public/interfaces/account_id.mojom";
import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/time.mojom";
import "skia/public/interfaces/bitmap.mojom";
import "url/mojom/url.mojom";

Expand Down Expand Up @@ -170,7 +170,7 @@ interface WallpaperController {

// Sets wallpaper animation duration. Passing an empty value disables the
// animation.
SetAnimationDuration(mojo.common.mojom.TimeDelta animation_duration);
SetAnimationDuration(mojo_base.mojom.TimeDelta animation_duration);

// Opens the wallpaper picker if the active user is not controlled by policy
// and it's allowed to change wallpaper per the user type and the login state.
Expand Down
2 changes: 1 addition & 1 deletion cc/ipc/cc_serialization_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "gpu/ipc/common/mailbox_struct_traits.h"
#include "gpu/ipc/common/sync_token_struct_traits.h"
#include "ipc/ipc_message.h"
#include "mojo/common/time_struct_traits.h"
#include "mojo/public/cpp/base/time_mojom_traits.h"
#include "mojo/public/cpp/bindings/message.h"
#include "services/viz/public/cpp/compositing/compositor_frame_metadata_struct_traits.h"
#include "services/viz/public/cpp/compositing/compositor_frame_struct_traits.h"
Expand Down
4 changes: 2 additions & 2 deletions chrome/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ mojom("page_load_metrics_mojom") {
]

public_deps = [
"//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
"//third_party/WebKit/public:web_feature_mojo_bindings",
]
}
Expand All @@ -739,7 +739,7 @@ mojom("client_hints_mojom") {
]

public_deps = [
"//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
"//third_party/WebKit/public:web_client_hints_types_mojo_bindings",
"//url/mojom:url_mojom_origin",
]
Expand Down
4 changes: 2 additions & 2 deletions chrome/common/client_hints.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module client_hints.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";
import "third_party/WebKit/public/platform/web_client_hints_types.mojom";
import "url/mojom/origin.mojom";

Expand All @@ -15,5 +15,5 @@ import "url/mojom/origin.mojom";
interface ClientHints {
PersistClientHints(url.mojom.Origin primary_origin,
array<blink.mojom.WebClientHintsType> client_hints,
mojo.common.mojom.TimeDelta expiration_duration);
mojo_base.mojom.TimeDelta expiration_duration);
};
4 changes: 2 additions & 2 deletions chrome/common/media_router/mojo/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mojom("media_controller") {
]

public_deps = [
"//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
]
}

Expand All @@ -23,7 +23,7 @@ mojom("media_router") {
public_deps = [
":media_controller",
"//media/mojo/interfaces:mirror_service_remoting",
"//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
"//net/interfaces:interfaces",
"//url/mojom:url_mojom_gurl",
"//url/mojom:url_mojom_origin",
Expand Down
4 changes: 2 additions & 2 deletions chrome/common/media_router/mojo/media_controller.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module media_router.mojom;

import "chrome/common/media_router/mojo/media_status.mojom";
import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";

// Interface for a controller to change the current state of a media content.
// This interface should be kept free of details specific to Media Router, so
Expand All @@ -31,7 +31,7 @@ interface MediaController {

// Sets the current playback position. |time| must be less than or equal to
// the duration of the media. Is a no-op if the media doesn't support seeking.
Seek(mojo.common.mojom.TimeDelta time);
Seek(mojo_base.mojom.TimeDelta time);

// Requests additional interface for commands used only for Hangouts routes.
// TODO(crbug.com/684642): Moving this method to the MediaRouteProvider
Expand Down
8 changes: 4 additions & 4 deletions chrome/common/media_router/mojo/media_router.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module media_router.mojom;
import "chrome/common/media_router/mojo/media_controller.mojom";
import "chrome/common/media_router/mojo/media_status.mojom";
import "media/mojo/interfaces/mirror_service_remoting.mojom";
import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";
import "net/interfaces/ip_address.mojom";
import "net/interfaces/ip_endpoint.mojom";
import "url/mojom/origin.mojom";
Expand Down Expand Up @@ -277,7 +277,7 @@ interface MediaRouteProvider {
string original_presentation_id,
url.mojom.Origin origin,
int32 tab_id,
mojo.common.mojom.TimeDelta timeout,
mojo_base.mojom.TimeDelta timeout,
bool incognito) =>
(MediaRoute? route,
string? error_text,
Expand Down Expand Up @@ -305,7 +305,7 @@ interface MediaRouteProvider {
string presentation_id,
url.mojom.Origin origin,
int32 tab_id,
mojo.common.mojom.TimeDelta timeout,
mojo_base.mojom.TimeDelta timeout,
bool incognito) =>
(MediaRoute? route,
string? error_text,
Expand Down Expand Up @@ -339,7 +339,7 @@ interface MediaRouteProvider {
string presentation_id,
url.mojom.Origin origin,
int32 tab_id,
mojo.common.mojom.TimeDelta timeout,
mojo_base.mojom.TimeDelta timeout,
bool incognito) =>
(MediaRoute? route,
string? error_text,
Expand Down
6 changes: 3 additions & 3 deletions chrome/common/media_router/mojo/media_status.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module media_router.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";

// Represents the current state of a media content. This struct should be kept
// free of details specific to Media Router, so that it can be moved to the
Expand Down Expand Up @@ -50,10 +50,10 @@ struct MediaStatus {

// The length of the media. A value of 0 indicates that this is a media with
// no set duration (e.g. a live stream).
mojo.common.mojom.TimeDelta duration;
mojo_base.mojom.TimeDelta duration;

// Current playback position. Must be less than or equal to |duration|.
mojo.common.mojom.TimeDelta current_time;
mojo_base.mojom.TimeDelta current_time;

// Only set for Hangouts routes.
HangoutsMediaStatusExtraData? hangouts_extra_data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "chrome/common/media_router/mojo/media_status_struct_traits.h"

#include "base/strings/string_util.h"
#include "mojo/common/time_struct_traits.h"
#include "mojo/public/cpp/base/time_mojom_traits.h"

namespace mojo {

Expand Down
48 changes: 24 additions & 24 deletions chrome/common/page_load_metrics/page_load_metrics.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,52 @@

module page_load_metrics.mojom;

import "mojo/common/time.mojom";
import "mojo/public/mojom/base/time.mojom";
import "third_party/WebKit/public/platform/web_feature.mojom";

// TimeDeltas below relative to navigation start.
struct DocumentTiming {
// Time immediately before the DOMContentLoaded event is fired.
mojo.common.mojom.TimeDelta? dom_content_loaded_event_start;
mojo_base.mojom.TimeDelta? dom_content_loaded_event_start;

// Time immediately before the load event is fired.
mojo.common.mojom.TimeDelta? load_event_start;
mojo_base.mojom.TimeDelta? load_event_start;

// Time when the first layout is completed.
mojo.common.mojom.TimeDelta? first_layout;
mojo_base.mojom.TimeDelta? first_layout;
};

// TimeDeltas below relative to navigation start.
struct PaintTiming {
// Time when the first paint is performed.
mojo.common.mojom.TimeDelta? first_paint;
mojo_base.mojom.TimeDelta? first_paint;

// Time when the first non-blank text is painted.
mojo.common.mojom.TimeDelta? first_text_paint;
mojo_base.mojom.TimeDelta? first_text_paint;

// Time when the first image is painted.
mojo.common.mojom.TimeDelta? first_image_paint;
mojo_base.mojom.TimeDelta? first_image_paint;

// Time when the first contentful thing (image, text, etc.) is painted.
mojo.common.mojom.TimeDelta? first_contentful_paint;
mojo_base.mojom.TimeDelta? first_contentful_paint;

// (Experimental) Time when the page's primary content is painted.
mojo.common.mojom.TimeDelta? first_meaningful_paint;
mojo_base.mojom.TimeDelta? first_meaningful_paint;
};

// TimeDeltas below represent durations of time during the page load.
struct ParseTiming {
// Time that the document's parser started and stopped parsing main resource
// content.
mojo.common.mojom.TimeDelta? parse_start;
mojo.common.mojom.TimeDelta? parse_stop;
mojo_base.mojom.TimeDelta? parse_start;
mojo_base.mojom.TimeDelta? parse_stop;

// Sum of times when the parser is blocked waiting on the load of a script.
// This duration takes place between parser_start and parser_stop, and thus
// must be less than or equal to parser_stop - parser_start. Note that this
// value may be updated multiple times during the period between parse_start
// and parse_stop.
mojo.common.mojom.TimeDelta? parse_blocked_on_script_load_duration;
mojo_base.mojom.TimeDelta? parse_blocked_on_script_load_duration;

// Sum of times when the parser is blocked waiting on the load of a script
// that was inserted from document.write. This duration must be less than or
Expand All @@ -58,58 +58,58 @@ struct ParseTiming {
// parse_stop. Note that some uncommon cases where scripts are loaded via
// document.write are not currently covered by this field. See crbug/600711
// for details.
mojo.common.mojom.TimeDelta? parse_blocked_on_script_load_from_document_write_duration;
mojo_base.mojom.TimeDelta? parse_blocked_on_script_load_from_document_write_duration;

// Sum of times when the parser is executing a script. This duration takes
// place between parser_start and parser_stop, and thus must be less than or
// equal to parser_stop - parser_start. Note that this value may be updated
// multiple times during the period between parse_start and parse_stop.
mojo.common.mojom.TimeDelta? parse_blocked_on_script_execution_duration;
mojo_base.mojom.TimeDelta? parse_blocked_on_script_execution_duration;

// Sum of times when the parser is executing a script that was inserted from
// document.write. This duration must be less than or equal to
// parse_blocked_on_script_load_duration. Note that this value may be updated
// multiple times during the period between parse_start and parse_stop. Note
// that some uncommon cases where scripts are loaded via document.write are
// not currently covered by this field. See crbug/600711 for details.
mojo.common.mojom.TimeDelta? parse_blocked_on_script_execution_from_document_write_duration;
mojo_base.mojom.TimeDelta? parse_blocked_on_script_execution_from_document_write_duration;
};

struct StyleSheetTiming {
// Total time spent parsing author style sheets, before the first contentful
// paint.
mojo.common.mojom.TimeDelta? author_style_sheet_parse_duration_before_fcp;
mojo_base.mojom.TimeDelta? author_style_sheet_parse_duration_before_fcp;
// Time spent in Document::updateStyle before FCP.
mojo.common.mojom.TimeDelta? update_style_duration_before_fcp;
mojo_base.mojom.TimeDelta? update_style_duration_before_fcp;
};

struct InteractiveTiming {
// The first time the page is considered 'interactive'. This is determined
// using heuristics based on main thread and network activity. Time delta is
// relative to navigation_start.
mojo.common.mojom.TimeDelta? interactive;
mojo_base.mojom.TimeDelta? interactive;

// The time of when we detect the page is interactive. There is a delay
// between when the page was interactive and when we were able to detect it.
// Time delta is relative to navigation_start.
// This is a page load metrics internal value and not generally intended for
// consumption by observers.
mojo.common.mojom.TimeDelta? interactive_detection;
mojo_base.mojom.TimeDelta? interactive_detection;


// The time of when a significant input event happened that may cause
// observers to discard the value of Time to Interactive. Time delta is
// relative to navigation start.
// This is a page load metrics internal value and not generally intended for
// consumption by observers.
mojo.common.mojom.TimeDelta? first_invalidating_input;
mojo_base.mojom.TimeDelta? first_invalidating_input;

// Queueing Time of the first click, tap, key press, cancellable touchstart,
// or pointer down followed by a pointer up.
mojo.common.mojom.TimeDelta? first_input_delay;
mojo_base.mojom.TimeDelta? first_input_delay;

// The timestamp of the event whose delay is reported by GetFirstInputDelay().
mojo.common.mojom.TimeDelta? first_input_timestamp;
mojo_base.mojom.TimeDelta? first_input_timestamp;
};


Expand All @@ -121,11 +121,11 @@ struct PageLoadTiming {
// this field is only used for internal tracking purposes and should not be
// used by PageLoadMetricsObservers. This field will likely be removed in the
// future.
mojo.common.mojom.Time navigation_start;
mojo_base.mojom.Time navigation_start;

// Time relative to navigation_start that the first byte of the response is
// received.
mojo.common.mojom.TimeDelta? response_start;
mojo_base.mojom.TimeDelta? response_start;
DocumentTiming document_timing;
InteractiveTiming interactive_timing;
PaintTiming paint_timing;
Expand Down
Loading

0 comments on commit 57e8dca

Please sign in to comment.