worker_storage_partition.cc revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "content/browser/worker_host/worker_storage_partition.h"
6
7#include <string>
8
9#include "content/browser/appcache/chrome_appcache_service.h"
10#include "content/browser/in_process_webkit/indexed_db_context_impl.h"
11#include "net/url_request/url_request_context_getter.h"
12#include "webkit/database/database_tracker.h"
13#include "webkit/fileapi/file_system_context.h"
14#include "webkit/quota/quota_manager.h"
15
16namespace content {
17
18WorkerStoragePartition::WorkerStoragePartition(
19    net::URLRequestContextGetter* url_request_context,
20    net::URLRequestContextGetter* media_url_request_context,
21    ChromeAppCacheService* appcache_service,
22    quota::QuotaManager* quota_manager,
23    fileapi::FileSystemContext* filesystem_context,
24    webkit_database::DatabaseTracker* database_tracker,
25    IndexedDBContextImpl* indexed_db_context)
26    : url_request_context_(url_request_context),
27      media_url_request_context_(media_url_request_context),
28      appcache_service_(appcache_service),
29      quota_manager_(quota_manager),
30      filesystem_context_(filesystem_context),
31      database_tracker_(database_tracker),
32      indexed_db_context_(indexed_db_context) {
33}
34
35WorkerStoragePartition::WorkerStoragePartition(
36    const WorkerStoragePartition& other) {
37  Copy(other);
38}
39
40const WorkerStoragePartition& WorkerStoragePartition::operator=(
41    const WorkerStoragePartition& rhs) {
42  Copy(rhs);
43  return *this;
44}
45
46bool WorkerStoragePartition::Equals(
47    const WorkerStoragePartition& other) const {
48  return url_request_context_ == other.url_request_context_ &&
49         media_url_request_context_ == other.media_url_request_context_ &&
50         appcache_service_ == other.appcache_service_ &&
51         quota_manager_ == other.quota_manager_ &&
52         filesystem_context_ == other.filesystem_context_ &&
53         database_tracker_ == other.database_tracker_ &&
54         indexed_db_context_ == other.indexed_db_context_;
55}
56
57WorkerStoragePartition::~WorkerStoragePartition() {
58}
59
60void WorkerStoragePartition::Copy(const WorkerStoragePartition& other) {
61  url_request_context_ = other.url_request_context_;
62  media_url_request_context_ = other.media_url_request_context_;
63  appcache_service_ = other.appcache_service_;
64  quota_manager_ = other.quota_manager_;
65  filesystem_context_ = other.filesystem_context_;
66  database_tracker_ = other.database_tracker_;
67  indexed_db_context_ = other.indexed_db_context_;
68}
69
70}  // namespace content
71