Skip to content

Commit

Permalink
Auto merge of #12770 - nox:intermittent-study, r=SimonSapin
Browse files Browse the repository at this point in the history
Use expect calls to investigate #12540 and #12288

<!-- 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/12770)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Aug 8, 2016
2 parents 3ae94fc + dc3c469 commit c420a87
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions components/gfx/font_cache_thread.rs
Expand Up @@ -423,10 +423,13 @@ impl FontCacheThread {

pub fn find_font_template(&self, family: FontFamily, desc: FontTemplateDescriptor)
-> Option<FontTemplateInfo> {
let (response_chan, response_port) = ipc::channel().unwrap();
self.chan.send(Command::GetFontTemplate(family, desc, response_chan)).unwrap();
let (response_chan, response_port) =
ipc::channel().expect("failed to create IPC channel");
self.chan.send(Command::GetFontTemplate(family, desc, response_chan))
.expect("failed to send message to font cache thread");

let reply = response_port.recv().unwrap();
let reply = response_port.recv()
.expect("failed to receive response to font request");

match reply {
Reply::GetFontTemplateReply(data) => {
Expand All @@ -437,10 +440,13 @@ impl FontCacheThread {

pub fn last_resort_font_template(&self, desc: FontTemplateDescriptor)
-> FontTemplateInfo {
let (response_chan, response_port) = ipc::channel().unwrap();
self.chan.send(Command::GetLastResortFontTemplate(desc, response_chan)).unwrap();
let (response_chan, response_port) =
ipc::channel().expect("failed to create IPC channel");
self.chan.send(Command::GetLastResortFontTemplate(desc, response_chan))
.expect("failed to send message to font cache thread");

let reply = response_port.recv().unwrap();
let reply = response_port.recv()
.expect("failed to receive response to font request");

match reply {
Reply::GetFontTemplateReply(data) => {
Expand Down

0 comments on commit c420a87

Please sign in to comment.