c4milo / node-webkit-agent

NodeJS agent for WebKit devtools front-end
http://c4milo.github.io/node-webkit-agent/
1.1k stars 128 forks source link

setRecordingProfile is going away in DevTools front ends #56

Open bpytlik opened 10 years ago

bpytlik commented 10 years ago

In issue 106252002 setRecordingProfile was removed from DevTools front ends as an interface. According to an email exchange I had, it's been replaced by '... Profile.consoleProfileStarted/consoleProfileFinished events to signal front-end that application initiated profile started/finished...'. I stumbled across this while trying to wrap my head around how node-webkit-agent works.

c4milo commented 10 years ago

I can help you understand how this project works if you ask me specific questions about anything. It will save you time.

bpytlik commented 10 years ago

Thanks, I'll be sure to ask you questions in the future where I can't figure things out. In this case, I was trying to find documentation for what the protocol was node-webkit-agent used to communicate with DevTools. I noticed that setRecordingProfile was one of the things that it sent and that that seemed to change the state of the button in DevTools. So, I searched for that thinking it would lead me to a useful protocol definition (as all the ones I'd found in the chromium documentation hadn't actually defined what messages could actually be sent over the protocol). That ended up taking me to the issue referenced above which it seemed like would be useful for you to know about if you didn't already.

I eventually found the devtools/protocol.json file which seemed to me to be what I was looking for. All of this was done in the hope of figuring out how to add flamegraphs as those seem like they would be useful. I was trying to determine what infrastructure DevTools needed to support flamegraphs to figure out what needed to be added to webkit-agent.

c4milo commented 10 years ago

Oh I see. Indeed, Chromium project doesn't have documented the part of the protocol related to profiling. So, I had to discover it by myself. I believe the same would have to be done for flamegraphs. I would usually study Chromium codebase to see how the interaction happens between Devtools Frontend and the Chromium backend.

Current Devtools frontends supported by this project don't have the UI for Flamegraphs. So, we need to integrate the latest stable Devtools frontend that comes with Chromium. I laid out more or less the process to extract it here: https://github.com/c4milo/node-webkit-agent/blob/gh-pages/README.md BUT the Chromium team has recently improved a lot the documentation for Devtools contributors, and they most likely have a better workflow now, check it out: https://developers.google.com/chrome-developer-tools/docs/contributing.