[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / content / browser / worker_host / worker_storage_partition.cc
blobad564c3ccaddb3514638e94bf89e306502dcf491
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.
5 #include "content/browser/worker_host/worker_storage_partition.h"
7 #include <string>
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"
15 namespace content {
17 WorkerStoragePartition::WorkerStoragePartition(
18 net::URLRequestContextGetter* url_request_context,
19 net::URLRequestContextGetter* media_url_request_context,
20 ChromeAppCacheService* appcache_service,
21 fileapi::FileSystemContext* filesystem_context,
22 webkit_database::DatabaseTracker* database_tracker,
23 IndexedDBContextImpl* indexed_db_context)
24 : url_request_context_(url_request_context),
25 media_url_request_context_(media_url_request_context),
26 appcache_service_(appcache_service),
27 filesystem_context_(filesystem_context),
28 database_tracker_(database_tracker),
29 indexed_db_context_(indexed_db_context) {
32 WorkerStoragePartition::WorkerStoragePartition(
33 const WorkerStoragePartition& other) {
34 Copy(other);
37 const WorkerStoragePartition& WorkerStoragePartition::operator=(
38 const WorkerStoragePartition& rhs) {
39 Copy(rhs);
40 return *this;
43 bool WorkerStoragePartition::Equals(
44 const WorkerStoragePartition& other) const {
45 return url_request_context_ == other.url_request_context_ &&
46 media_url_request_context_ == other.media_url_request_context_ &&
47 appcache_service_ == other.appcache_service_ &&
48 filesystem_context_ == other.filesystem_context_ &&
49 database_tracker_ == other.database_tracker_ &&
50 indexed_db_context_ == other.indexed_db_context_;
53 WorkerStoragePartition::~WorkerStoragePartition() {
56 void WorkerStoragePartition::Copy(const WorkerStoragePartition& other) {
57 url_request_context_ = other.url_request_context_;
58 media_url_request_context_ = other.media_url_request_context_;
59 appcache_service_ = other.appcache_service_;
60 filesystem_context_ = other.filesystem_context_;
61 database_tracker_ = other.database_tracker_;
62 indexed_db_context_ = other.indexed_db_context_;
65 } // namespace content