Auto merge of #17383 - o0Ignition0o:profiler_chan_by_reference, r=jdm

#17363 : Passing ProfilerChan by reference to the send_profile_data method.

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17383)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-25 09:06:28 -07:00 committed by GitHub
commit d8ae463839
2 changed files with 3 additions and 3 deletions

View file

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

View file

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