summaryrefslogtreecommitdiffstats
path: root/content/browser/download/download_id_factory.cc
blob: 6b0797f88c4a9f559c60b96f147082cca8a48ef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (c) 2011 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 "content/browser/download/download_id_factory.h"

#include "content/browser/download/download_id.h"

DownloadIdFactory::DownloadIdFactory(DownloadId::Domain domain)
  : domain_(domain),
    next_id_(0) {
}

DownloadId DownloadIdFactory::GetNextId() {
  base::AutoLock lock(lock_);
  return DownloadId(domain_, next_id_++);
}