Skip to content

Commit 29f6531

Browse files
committed
Make glean dependency optional for webrender
1 parent 3576961 commit 29f6531

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: webrender/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ svg_fmt = "0.4"
5252
tracy-rs = "0.1.2"
5353
derive_more = { version = "0.99", default-features = false, features = ["add_assign"] }
5454
etagere = "0.2.6"
55-
glean = "57.0.0"
55+
glean = { version = "57.0.0", optional = true }
5656
firefox-on-glean = { version = "0.1.0", optional = true }
5757
swgl = { path = "../swgl", optional = true }
5858
topological-sort = "0.1"

Diff for: webrender/src/telemetry.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#[cfg(feature = "gecko")]
56
use glean::TimerId;
67
#[cfg(feature = "gecko")]
78
use firefox_on_glean::metrics::wr;
89
use std::time::Duration;
910

1011
pub struct Telemetry;
1112

13+
#[cfg(not(feature = "gecko"))]
14+
pub struct TimerId;
15+
1216
/// Defines the interface for hooking up an external telemetry reporter to WR.
1317
#[cfg(not(feature = "gecko"))]
1418
impl Telemetry {
1519
pub fn record_rasterize_blobs_time(_duration: Duration) { }
16-
pub fn start_framebuild_time() -> TimerId { TimerId { id: 0 } }
20+
pub fn start_framebuild_time() -> TimerId { TimerId { } }
1721
pub fn stop_and_accumulate_framebuild_time(_id: TimerId) { }
1822
pub fn record_renderer_time(_duration: Duration) { }
1923
pub fn record_renderer_time_no_sc(_duration: Duration) { }
2024
pub fn record_scenebuild_time(_duration: Duration) { }
21-
pub fn start_sceneswap_time() -> TimerId { TimerId { id: 0 } }
25+
pub fn start_sceneswap_time() -> TimerId { TimerId { } }
2226
pub fn stop_and_accumulate_sceneswap_time(_id: TimerId) { }
2327
pub fn cancel_sceneswap_time(_id: TimerId) { }
2428
pub fn record_texture_cache_update_time(_duration: Duration) { }

0 commit comments

Comments
 (0)