michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "GeckoProfiler.h" michael@0: #include "ProfilerIOInterposeObserver.h" michael@0: #include "ProfilerMarkers.h" michael@0: michael@0: using namespace mozilla; michael@0: michael@0: void ProfilerIOInterposeObserver::Observe(Observation& aObservation) michael@0: { michael@0: if (!IsMainThread()) { michael@0: return; michael@0: } michael@0: michael@0: ProfilerBacktrace* stack = profiler_get_backtrace(); michael@0: michael@0: nsCString filename; michael@0: if (aObservation.Filename()) { michael@0: filename = NS_ConvertUTF16toUTF8(aObservation.Filename()); michael@0: } michael@0: michael@0: IOMarkerPayload* markerPayload = new IOMarkerPayload(aObservation.Reference(), michael@0: filename.get(), michael@0: aObservation.Start(), michael@0: aObservation.End(), michael@0: stack); michael@0: PROFILER_MARKER_PAYLOAD(aObservation.ObservedOperationString(), markerPayload); michael@0: }