Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: content/browser/storage_partition_impl.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test compilation. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "content/browser/storage_partition_impl.h" 5 #include "content/browser/storage_partition_impl.h"
6 6
7 #include "base/sequenced_task_runner.h" 7 #include "base/sequenced_task_runner.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/browser_main_loop.h" 9 #include "content/browser/browser_main_loop.h"
10 #include "content/browser/fileapi/browser_file_system_helper.h" 10 #include "content/browser/fileapi/browser_file_system_helper.h"
11 #include "content/browser/gpu/shader_disk_cache.h" 11 #include "content/browser/gpu/shader_disk_cache.h"
12 #include "content/browser/host_zoom_level_context.h"
13 #include "content/browser/host_zoom_map_impl.h"
12 #include "content/common/dom_storage/dom_storage_types.h" 14 #include "content/common/dom_storage/dom_storage_types.h"
13 #include "content/public/browser/browser_context.h" 15 #include "content/public/browser/browser_context.h"
14 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/dom_storage_context.h" 17 #include "content/public/browser/dom_storage_context.h"
16 #include "content/public/browser/indexed_db_context.h" 18 #include "content/public/browser/indexed_db_context.h"
17 #include "content/public/browser/local_storage_usage_info.h" 19 #include "content/public/browser/local_storage_usage_info.h"
18 #include "content/public/browser/session_storage_usage_info.h" 20 #include "content/public/browser/session_storage_usage_info.h"
19 #include "net/base/completion_callback.h" 21 #include "net/base/completion_callback.h"
20 #include "net/base/net_errors.h" 22 #include "net/base/net_errors.h"
21 #include "net/cookies/cookie_monster.h" 23 #include "net/cookies/cookie_monster.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 StoragePartitionImpl::StoragePartitionImpl( 353 StoragePartitionImpl::StoragePartitionImpl(
352 const base::FilePath& partition_path, 354 const base::FilePath& partition_path,
353 quota::QuotaManager* quota_manager, 355 quota::QuotaManager* quota_manager,
354 ChromeAppCacheService* appcache_service, 356 ChromeAppCacheService* appcache_service,
355 fileapi::FileSystemContext* filesystem_context, 357 fileapi::FileSystemContext* filesystem_context,
356 webkit_database::DatabaseTracker* database_tracker, 358 webkit_database::DatabaseTracker* database_tracker,
357 DOMStorageContextWrapper* dom_storage_context, 359 DOMStorageContextWrapper* dom_storage_context,
358 IndexedDBContextImpl* indexed_db_context, 360 IndexedDBContextImpl* indexed_db_context,
359 ServiceWorkerContextWrapper* service_worker_context, 361 ServiceWorkerContextWrapper* service_worker_context,
360 WebRTCIdentityStore* webrtc_identity_store, 362 WebRTCIdentityStore* webrtc_identity_store,
361 quota::SpecialStoragePolicy* special_storage_policy) 363 quota::SpecialStoragePolicy* special_storage_policy,
364 scoped_ptr<HostZoomLevelContext> host_zoom_level_context)
362 : partition_path_(partition_path), 365 : partition_path_(partition_path),
363 quota_manager_(quota_manager), 366 quota_manager_(quota_manager),
364 appcache_service_(appcache_service), 367 appcache_service_(appcache_service),
365 filesystem_context_(filesystem_context), 368 filesystem_context_(filesystem_context),
366 database_tracker_(database_tracker), 369 database_tracker_(database_tracker),
367 dom_storage_context_(dom_storage_context), 370 dom_storage_context_(dom_storage_context),
368 indexed_db_context_(indexed_db_context), 371 indexed_db_context_(indexed_db_context),
369 service_worker_context_(service_worker_context), 372 service_worker_context_(service_worker_context),
370 webrtc_identity_store_(webrtc_identity_store), 373 webrtc_identity_store_(webrtc_identity_store),
371 special_storage_policy_(special_storage_policy) {} 374 special_storage_policy_(special_storage_policy),
375 host_zoom_level_context_(host_zoom_level_context.release()) {}
372 376
373 StoragePartitionImpl::~StoragePartitionImpl() { 377 StoragePartitionImpl::~StoragePartitionImpl() {
374 // These message loop checks are just to avoid leaks in unittests. 378 // These message loop checks are just to avoid leaks in unittests.
375 if (GetDatabaseTracker() && 379 if (GetDatabaseTracker() &&
376 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { 380 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) {
377 BrowserThread::PostTask( 381 BrowserThread::PostTask(
378 BrowserThread::FILE, FROM_HERE, 382 BrowserThread::FILE, FROM_HERE,
379 base::Bind(&webkit_database::DatabaseTracker::Shutdown, 383 base::Bind(&webkit_database::DatabaseTracker::Shutdown,
380 GetDatabaseTracker())); 384 GetDatabaseTracker()));
381 } 385 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 456
453 scoped_refptr<ChromeAppCacheService> appcache_service = 457 scoped_refptr<ChromeAppCacheService> appcache_service =
454 new ChromeAppCacheService(quota_manager->proxy()); 458 new ChromeAppCacheService(quota_manager->proxy());
455 459
456 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store( 460 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store(
457 new WebRTCIdentityStore(path, context->GetSpecialStoragePolicy())); 461 new WebRTCIdentityStore(path, context->GetSpecialStoragePolicy()));
458 462
459 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy( 463 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy(
460 context->GetSpecialStoragePolicy()); 464 context->GetSpecialStoragePolicy());
461 465
466 scoped_ptr<HostZoomLevelContext> host_zoom_level_context(
467 new HostZoomLevelContext(context->CreateZoomLevelPrefsStore(),
468 partition_path));
469
462 return new StoragePartitionImpl(partition_path, 470 return new StoragePartitionImpl(partition_path,
463 quota_manager.get(), 471 quota_manager.get(),
464 appcache_service.get(), 472 appcache_service.get(),
465 filesystem_context.get(), 473 filesystem_context.get(),
466 database_tracker.get(), 474 database_tracker.get(),
467 dom_storage_context.get(), 475 dom_storage_context.get(),
468 indexed_db_context.get(), 476 indexed_db_context.get(),
469 service_worker_context.get(), 477 service_worker_context.get(),
470 webrtc_identity_store.get(), 478 webrtc_identity_store.get(),
471 special_storage_policy.get()); 479 special_storage_policy.get(),
480 host_zoom_level_context.Pass());
472 } 481 }
473 482
474 base::FilePath StoragePartitionImpl::GetPath() { 483 base::FilePath StoragePartitionImpl::GetPath() {
475 return partition_path_; 484 return partition_path_;
476 } 485 }
477 486
478 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 487 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
479 return url_request_context_.get(); 488 return url_request_context_.get();
480 } 489 }
481 490
(...skipping 23 matching lines...) Expand all
505 } 514 }
506 515
507 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { 516 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() {
508 return indexed_db_context_.get(); 517 return indexed_db_context_.get();
509 } 518 }
510 519
511 ServiceWorkerContextWrapper* StoragePartitionImpl::GetServiceWorkerContext() { 520 ServiceWorkerContextWrapper* StoragePartitionImpl::GetServiceWorkerContext() {
512 return service_worker_context_.get(); 521 return service_worker_context_.get();
513 } 522 }
514 523
524 HostZoomMap* StoragePartitionImpl::GetHostZoomMap() {
525 DCHECK(host_zoom_level_context_);
526 return host_zoom_level_context_->GetHostZoomMap();
527 }
528
529 PrefService* StoragePartitionImpl::GetZoomLevelPrefs() {
530 DCHECK(host_zoom_level_context_);
531 return host_zoom_level_context_->GetZoomLevelPrefs();
532 }
533
515 void StoragePartitionImpl::ClearDataImpl( 534 void StoragePartitionImpl::ClearDataImpl(
516 uint32 remove_mask, 535 uint32 remove_mask,
517 uint32 quota_storage_remove_mask, 536 uint32 quota_storage_remove_mask,
518 const GURL& storage_origin, 537 const GURL& storage_origin,
519 const OriginMatcherFunction& origin_matcher, 538 const OriginMatcherFunction& origin_matcher,
520 net::URLRequestContextGetter* rq_context, 539 net::URLRequestContextGetter* rq_context,
521 const base::Time begin, 540 const base::Time begin,
522 const base::Time end, 541 const base::Time end,
523 const base::Closure& callback) { 542 const base::Closure& callback) {
524 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 543 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 net::URLRequestContextGetter* url_request_context) { 827 net::URLRequestContextGetter* url_request_context) {
809 url_request_context_ = url_request_context; 828 url_request_context_ = url_request_context;
810 } 829 }
811 830
812 void StoragePartitionImpl::SetMediaURLRequestContext( 831 void StoragePartitionImpl::SetMediaURLRequestContext(
813 net::URLRequestContextGetter* media_url_request_context) { 832 net::URLRequestContextGetter* media_url_request_context) {
814 media_url_request_context_ = media_url_request_context; 833 media_url_request_context_ = media_url_request_context;
815 } 834 }
816 835
817 } // namespace content 836 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698