servo: Merge #17383 - #17363 : Passing ProfilerChan by reference to the send_profile_data method (from o0Ignition0o:profiler_chan_by_reference); r=jdm

<!-- Please describe your changes on the following line: -->
Passed the ProfilerChan by reference to the send_profile_data method.

I wonder if I should also refactor the
`pub fn profile<T, F>(category: ProfilerCategory, meta: Option<TimerMetadata>, profiler_chan: ProfilerChan, callback: F) -> T where F: FnOnce() -> T method ` , but I don't feel confident enough to make the call, since I don't really understand what it would imply.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17363 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the project would not compile if there were missing by reference calls.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: d8ae4638397a3834203267ceae075509e9cb9931

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 79e9240a4279e5bf6fa0ac2c835572493926183c
This commit is contained in:
Jeremy Lempereur 2017-06-25 09:06:28 -07:00
Родитель dfc1ad2562
Коммит 9e826bc61e
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -1253,7 +1253,7 @@ impl LayoutThread {
(self.layout_threads as u64);
time::send_profile_data(time::ProfilerCategory::LayoutTextShaping,
self.profiler_metadata(),
self.time_profiler_chan.clone(),
&self.time_profiler_chan,
0,
text_shaping_time,
0,

Просмотреть файл

@ -128,7 +128,7 @@ pub fn profile<T, F>(category: ProfilerCategory,
send_profile_data(category,
meta,
profiler_chan,
&profiler_chan,
start_time,
end_time,
start_energy,
@ -138,7 +138,7 @@ pub fn profile<T, F>(category: ProfilerCategory,
pub fn send_profile_data(category: ProfilerCategory,
meta: Option<TimerMetadata>,
profiler_chan: ProfilerChan,
profiler_chan: &ProfilerChan,
start_time: u64,
end_time: u64,
start_energy: u64,