summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_id.h
blob: 248d6021b5635f96ced7a7fa78cacfd081052069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2006-2008 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.

#ifndef CHROME_BROWSER_SESSIONS_SESSION_ID_H_
#define CHROME_BROWSER_SESSIONS_SESSION_ID_H_
#pragma once

#include "base/basictypes.h"

class NavigationController;
class SessionService;
namespace browser_sync {
  class SessionModelAssociator;
}

// Uniquely identifies a tab or window for the duration of a session.
class SessionID {
 public:
  typedef int32 id_type;

  SessionID();
  ~SessionID() {}

  // Returns the underlying id.
  id_type id() const { return id_; }

 private:
  friend class NavigationController;
  friend class SessionService;
  friend class browser_sync::SessionModelAssociator;

  explicit SessionID(id_type id) : id_(id) {}

  // Resets the id. This is used when restoring a session
  void set_id(id_type id) { id_ = id; }

  id_type id_;
};

#endif  // CHROME_BROWSER_SESSIONS_SESSION_ID_H_