aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-03-22 16:38:32 -0400
committerGitHub <noreply@github.com>2018-03-22 16:38:32 -0400
commitf467bdce1ba95e950b01f59ba284873137bca5d5 (patch)
tree34a249c2341216233d407c1e9c7a568698ccf5d5 /components/script/dom/blob.rs
parentc20d0c00d711cda61ad1b35f15f2fb563c042c5e (diff)
parent7d4e2b11e940545eaa74877b75908e1e02f6eeb5 (diff)
downloadservo-f467bdce1ba95e950b01f59ba284873137bca5d5.tar.gz
servo-f467bdce1ba95e950b01f59ba284873137bca5d5.zip
Auto merge of #20132 - nakul02:issue_19223, r=jdm
Profiler for blocked IpcReceiver::recv() <!-- Please describe your changes on the following line: --> Implements feature #19223 --- <!-- 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 #19223 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- 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. --> WIP. @jdm - this is the new profiler : "Blocked at IPC Receive" Should I dig through all the calls to `ipc::channel` and replace them with this profiled `IpcReceiver`? ![screenshot from 2018-02-27 01-35-37](https://user-images.githubusercontent.com/5394361/36721061-b46edea4-1b5e-11e8-91d6-7faba742f237.png) <!-- 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/20132) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r--components/script/dom/blob.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index beb7ed69df3..d8017f23ffa 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -12,10 +12,10 @@ use dom::bindings::root::{Dom, DomRoot};
use dom::bindings::str::DOMString;
use dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
-use ipc_channel::ipc;
use net_traits::{CoreResourceMsg, IpcSend};
use net_traits::blob_url_store::{BlobBuf, get_blob_origin};
use net_traits::filemanager_thread::{FileManagerThreadMsg, ReadFileProgress, RelativePos};
+use profile_traits::ipc;
use std::mem;
use std::ops::Index;
use std::path::PathBuf;
@@ -200,7 +200,7 @@ impl Blob {
BlobImpl::File(ref f) => {
if set_valid {
let origin = get_blob_origin(&global_url);
- let (tx, rx) = ipc::channel().unwrap();
+ let (tx, rx) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
let msg = FileManagerThreadMsg::ActivateBlobURL(f.id.clone(), tx, origin.clone());
self.send_to_file_manager(msg);
@@ -227,7 +227,7 @@ impl Blob {
bytes: bytes.to_vec(),
};
- let (tx, rx) = ipc::channel().unwrap();
+ let (tx, rx) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
let msg = FileManagerThreadMsg::PromoteMemory(blob_buf, set_valid, tx, origin.clone());
self.send_to_file_manager(msg);
@@ -251,7 +251,7 @@ impl Blob {
rel_pos: &RelativePos, parent_len: u64) -> Uuid {
let origin = get_blob_origin(&self.global().get_url());
- let (tx, rx) = ipc::channel().unwrap();
+ let (tx, rx) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
let msg = FileManagerThreadMsg::AddSlicedURLEntry(parent_id.clone(),
rel_pos.clone(),
tx, origin.clone());
@@ -280,7 +280,7 @@ impl Blob {
if let BlobImpl::File(ref f) = *self.blob_impl.borrow() {
let origin = get_blob_origin(&self.global().get_url());
- let (tx, rx) = ipc::channel().unwrap();
+ let (tx, rx) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
let msg = FileManagerThreadMsg::DecRef(f.id.clone(), origin, tx);
self.send_to_file_manager(msg);
@@ -303,7 +303,7 @@ impl Drop for Blob {
fn read_file(global: &GlobalScope, id: Uuid) -> Result<Vec<u8>, ()> {
let resource_threads = global.resource_threads();
- let (chan, recv) = ipc::channel().map_err(|_|())?;
+ let (chan, recv) = ipc::channel(global.time_profiler_chan().clone()).map_err(|_|())?;
let origin = get_blob_origin(&global.get_url());
let check_url_validity = false;
let msg = FileManagerThreadMsg::ReadFile(chan, id, check_url_validity, origin);