Skip to content

Instantly share code, notes, and snippets.

@natduca
Created January 29, 2016 01:46
Show Gist options
  • Save natduca/538dd52290ad5385cc13 to your computer and use it in GitHub Desktop.
Save natduca/538dd52290ad5385cc13 to your computer and use it in GitHub Desktop.
diff --git a/components/tracing/tracing_messages.h b/components/tracing/tracing_messages.h
index 11196e3..ca79708 100644
--- a/components/tracing/tracing_messages.h
+++ b/components/tracing/tracing_messages.h
@@ -132,3 +132,6 @@ IPC_MESSAGE_CONTROL2(TracingHostMsg_ProcessMemoryDumpResponse,
IPC_MESSAGE_CONTROL1(TracingHostMsg_TriggerBackgroundTrace,
std::string /* name */)
+
+
+// you need stuff here too
diff --git a/content/browser/tracing/trace_message_filter.cc b/content/browser/tracing/trace_message_filter.cc
index a26c654..c1777f6 100644
--- a/content/browser/tracing/trace_message_filter.cc
+++ b/content/browser/tracing/trace_message_filter.cc
@@ -43,6 +43,10 @@ bool TraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
// Always on IO thread (BrowserMessageFilter guarantee).
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(TraceMessageFilter, message)
+
+ you need a handler here ... it\'ll need a guard on the commandline being present, but then
+ it should be a simple call from here to TracingControllerImpl Start/Stop methods.
+
IPC_MESSAGE_HANDLER(TracingHostMsg_ChildSupportsTracing,
OnChildSupportsTracing)
IPC_MESSAGE_HANDLER(TracingHostMsg_EndTracingAck, OnEndTracingAck)
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc
index 454f5f5..5718244 100644
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "content/renderer/gpu/gpu_benchmarking_extension.h"
-
+// copy this file into something like tracing_Extension.cc maybe?
#include <string>
#include "base/base64.h"
@@ -356,6 +356,15 @@ bool BeginSmoothScroll(v8::Isolate* isolate,
// TODO(nduca): If the render_view_impl is destroyed while the gesture is in
// progress, we will leak the callback and context. This needs to be fixed,
// somehow.
+
+ // hereish in the v8 method implementaiton you'd want to do an IPC send to the
+ // browser-side tracing controller to start/stop/getdata.
+
+ // i think the main issue here is that i think tracing is a component. maybe components can have v8 extensions?
+
+ // if they cant, i could imagine the extension.cc could have a SetIPCDriver(SomeInterface*) and then the component
+ // can set that interface to here.
+
context.render_view_impl()->QueueSyntheticGesture(
gesture_params.Pass(),
base::Bind(&OnSyntheticGestureCompleted, callback_and_context));
@natduca
Copy link
Author

natduca commented Jan 29, 2016

you'd probably also need to poke at child_trace_message_filter, as thats the thing that recieves replies from teh browser process. that'd need to trampoline back into the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment