Skip to content

Commit

Permalink
Auto merge of #21943 - codehag:devtools-add-list-workers-method, r=jdm
Browse files Browse the repository at this point in the history
DevTools - add ListWorkers method to BrowsingContextTargetActor

This is one of three pull requests that allows the DevTools Debugger to render.

The two related prs are #21942 and #21944

This pr introduces a `ListWorkers` method, which the debugger relies on for startup. At the moment, we are returning an empty array, but later on we can return an array populated by all workers associated with a target.

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/21943)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Oct 14, 2018
2 parents a59bcd6 + 8d738f6 commit 4dcd1e7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions components/devtools/actors/browsing_context.rs
Expand Up @@ -54,6 +54,17 @@ struct FrameMsg {
parentID: u32,
}

#[derive(Serialize)]
struct ListWorkersReply {
from: String,
workers: Vec<WorkerMsg>,
}

#[derive(Serialize)]
struct WorkerMsg {
id: u32,
}

#[derive(Serialize)]
pub struct BrowsingContextActorMsg {
actor: String,
Expand Down Expand Up @@ -159,6 +170,15 @@ impl Actor for BrowsingContextActor {
ActorMessageStatus::Processed
},

"listWorkers" => {
let msg = ListWorkersReply {
from: self.name(),
workers: vec![],
};
stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},

_ => ActorMessageStatus::Ignored,
})
}
Expand Down

0 comments on commit 4dcd1e7

Please sign in to comment.