2015-06-11 00:58:30 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZ_PROFILE_GATHERER_H
|
|
|
|
#define MOZ_PROFILE_GATHERER_H
|
|
|
|
|
|
|
|
#include "mozilla/dom/Promise.h"
|
2016-11-18 21:48:00 +03:00
|
|
|
#include "nsIFile.h"
|
2015-06-11 00:58:30 +03:00
|
|
|
|
2017-01-25 06:34:25 +03:00
|
|
|
class Sampler;
|
2015-06-11 00:58:30 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-08-18 21:57:35 +03:00
|
|
|
class ProfileGatherer final : public nsIObserver
|
2015-06-11 00:58:30 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
2015-08-18 21:57:35 +03:00
|
|
|
NS_DECL_NSIOBSERVER
|
2015-06-11 00:58:30 +03:00
|
|
|
|
2017-01-25 06:34:25 +03:00
|
|
|
explicit ProfileGatherer(Sampler* aSampler);
|
2015-06-11 00:58:30 +03:00
|
|
|
void WillGatherOOPProfile();
|
|
|
|
void GatheredOOPProfile();
|
2015-12-01 21:01:27 +03:00
|
|
|
void Start(double aSinceTime, mozilla::dom::Promise* aPromise);
|
2016-11-18 21:48:00 +03:00
|
|
|
void Start(double aSinceTime, nsIFile* aFile);
|
|
|
|
void Start(double aSinceTime, const nsACString& aFileName);
|
2015-12-01 21:01:27 +03:00
|
|
|
void Cancel();
|
2015-08-18 21:57:35 +03:00
|
|
|
void OOPExitProfile(const nsCString& aProfile);
|
2015-06-11 00:58:30 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
~ProfileGatherer() {};
|
|
|
|
void Finish();
|
2015-12-01 21:01:27 +03:00
|
|
|
void Reset();
|
2015-06-11 00:58:30 +03:00
|
|
|
|
2015-08-18 21:57:35 +03:00
|
|
|
nsTArray<nsCString> mExitProfiles;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::dom::Promise> mPromise;
|
2016-11-18 21:48:00 +03:00
|
|
|
nsCOMPtr<nsIFile> mFile;
|
2017-01-25 06:34:25 +03:00
|
|
|
Sampler* mSampler;
|
2015-06-17 05:28:00 +03:00
|
|
|
double mSinceTime;
|
2015-06-11 00:58:30 +03:00
|
|
|
uint32_t mPendingProfiles;
|
2015-12-01 21:01:27 +03:00
|
|
|
bool mGathering;
|
2015-06-11 00:58:30 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-06-17 05:28:00 +03:00
|
|
|
#endif
|