FPRSessionManager+Private.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "FirebasePerformance/Sources/AppActivity/FPRSessionManager.h"
  16. #import "FirebasePerformance/Sources/Gauges/FPRGaugeManager.h"
  17. NS_ASSUME_NONNULL_BEGIN
  18. /** This extension should only be used for testing. */
  19. @interface FPRSessionManager ()
  20. @property(nonatomic) FPRGaugeManager *gaugeManager;
  21. /** The current active session managed by the session manager. Modifiable for unit tests */
  22. @property(atomic, nullable, readwrite) FPRSessionDetails *sessionDetails;
  23. /**
  24. * Creates an instance of FPRSesssionManager with the notification center provided. All the
  25. * notifications from the session manager will sent using this notification center.
  26. *
  27. * @param gaugeManager Gauge manager used by the session manager to work with gauges.
  28. * @param notificationCenter Notification center with which the session manager with be initialized.
  29. * @return Returns an instance of the session manager.
  30. */
  31. - (FPRSessionManager *)initWithGaugeManager:(FPRGaugeManager *)gaugeManager
  32. notificationCenter:(NSNotificationCenter *)notificationCenter;
  33. /**
  34. * Checks if the currently active session is beyond maximum allowed time for gauge-collection. If so
  35. * stop gauges, else no-op.
  36. */
  37. - (void)stopGaugesIfRunningTooLong;
  38. @end
  39. NS_ASSUME_NONNULL_END