| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/common/app_group/app_group_metrics.h" | 5 #include "ios/chrome/common/app_group/app_group_metrics.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
| 9 namespace app_group { | 13 namespace app_group { |
| 10 | 14 |
| 11 NSString* const kPendingLogFileSuffix = @"_PendingLog"; | 15 NSString* const kPendingLogFileSuffix = @"_PendingLog"; |
| 12 | 16 |
| 13 NSString* const kPendingLogFileDirectory = @"ExtensionLogs"; | 17 NSString* const kPendingLogFileDirectory = @"ExtensionLogs"; |
| 14 | 18 |
| 15 // To avoid collision between session_ids from chrome or external components, | 19 // To avoid collision between session_ids from chrome or external components, |
| 16 // the session ID is offset depending on the application. | 20 // the session ID is offset depending on the application. |
| 17 int AppGroupSessionID(int session_id, AppGroupApplications application) { | 21 int AppGroupSessionID(int session_id, AppGroupApplications application) { |
| 18 DCHECK_LT(session_id, 1 << 23); | 22 DCHECK_LT(session_id, 1 << 23); |
| 19 return (1 << 23) * static_cast<int>(application) + session_id; | 23 return (1 << 23) * static_cast<int>(application) + session_id; |
| 20 } | 24 } |
| 21 | 25 |
| 22 } // namespace app_group | 26 } // namespace app_group |
| OLD | NEW |