}
});
} else {
// We are dealing with RAW data (untransformed inspector data) that still
// needs conversion.
final Proxy proxy = new Proxy(tabId) {
@Override
protected void connectToDataSource() {
// Tell the data_loader content script to start sending.
port.postMessage(LoadFileDataInstance.createAck());
}
};
// Connect the DataInstance to receive data from the data_loader
port.getOnMessageEvent().addListener(new MessageEvent.Listener() {
boolean receivedFirstMessage;
public void onMessage(MessageEvent.Message message) {
if (!receivedFirstMessage) {
receivedFirstMessage = true;
tabModel.dataInstance.onTimelineProfilerStarted();
}
PageEventMessage pageEventMessage = message.cast();
// We don't support versioning for RAW data since it would mean
// maintaining support for multiple Chrome versions. We assume
// that RAW data should always be the same format as the current
// Chrome build.
proxy.dispatchDebuggerEventRecord(pageEventMessage.getDebuggerRecord());
}
});
tabModel.dataInstance = ChromeDebuggerDataInstance.create(proxy);
browserConn.tabMap.put(tabId, tabModel);