blob: ab973d9468aa7933aa0406d40d1ef9dbf579ed7d [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/chrome/common/app_group/app_group_metrics.h"
#include "base/logging.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace app_group {
NSString* const kPendingLogFileSuffix = @"_PendingLog";
NSString* const kPendingLogFileDirectory = @"ExtensionLogs";
// To avoid collision between session_ids from chrome or external components,
// the session ID is offset depending on the application.
int AppGroupSessionID(int session_id, AppGroupApplications application) {
DCHECK_LT(session_id, 1 << 23);
return (1 << 23) * static_cast<int>(application) + session_id;
}
} // namespace app_group