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

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

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. 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/public/browser/browser_context.h" 5 #include "content/public/browser/browser_context.h"
6 6
7 #if !defined(OS_IOS) 7 #if !defined(OS_IOS)
8 #include "content/browser/download/download_manager_impl.h" 8 #include "content/browser/download/download_manager_impl.h"
9 #include "content/browser/fileapi/chrome_blob_storage_context.h" 9 #include "content/browser/fileapi/chrome_blob_storage_context.h"
10 #include "content/browser/indexed_db/indexed_db_context_impl.h" 10 #include "content/browser/indexed_db/indexed_db_context_impl.h"
11 #include "content/browser/loader/resource_dispatcher_host_impl.h" 11 #include "content/browser/loader/resource_dispatcher_host_impl.h"
12 #include "content/browser/push_messaging_router.h" 12 #include "content/browser/push_messaging_router.h"
13 #include "content/browser/storage_partition_impl_map.h" 13 #include "content/browser/storage_partition_impl_map.h"
14 #include "content/common/child_process_host_impl.h" 14 #include "content/common/child_process_host_impl.h"
15 #include "content/public/browser/blob_handle.h" 15 #include "content/public/browser/blob_handle.h"
16 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/content_browser_client.h" 17 #include "content/public/browser/content_browser_client.h"
18 #include "content/public/browser/host_zoom_map.h"
18 #include "content/public/browser/site_instance.h" 19 #include "content/public/browser/site_instance.h"
19 #include "net/cookies/cookie_monster.h" 20 #include "net/cookies/cookie_monster.h"
20 #include "net/cookies/cookie_store.h" 21 #include "net/cookies/cookie_store.h"
21 #include "net/ssl/channel_id_service.h" 22 #include "net/ssl/channel_id_service.h"
22 #include "net/ssl/channel_id_store.h" 23 #include "net/ssl/channel_id_store.h"
23 #include "net/url_request/url_request_context.h" 24 #include "net/url_request/url_request_context.h"
24 #include "net/url_request/url_request_context_getter.h" 25 #include "net/url_request/url_request_context_getter.h"
25 #include "webkit/browser/database/database_tracker.h" 26 #include "webkit/browser/database/database_tracker.h"
26 #include "webkit/browser/fileapi/external_mount_points.h" 27 #include "webkit/browser/fileapi/external_mount_points.h"
27 #endif // !OS_IOS 28 #endif // !OS_IOS
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 context->channel_id_service()->GetChannelIDStore()-> 78 context->channel_id_service()->GetChannelIDStore()->
78 SetForceKeepSessionState(); 79 SetForceKeepSessionState();
79 appcache_service->set_force_keep_session_state(); 80 appcache_service->set_force_keep_session_state();
80 } 81 }
81 82
82 void SaveSessionStateOnIndexedDBThread( 83 void SaveSessionStateOnIndexedDBThread(
83 scoped_refptr<IndexedDBContextImpl> indexed_db_context) { 84 scoped_refptr<IndexedDBContextImpl> indexed_db_context) {
84 indexed_db_context->SetForceKeepSessionState(); 85 indexed_db_context->SetForceKeepSessionState();
85 } 86 }
86 87
88 void ChangeDefaultZoomForStoragePartition(
89 double level,
90 content::StoragePartition* partition) {
91 DCHECK(partition);
awong 2014/08/12 21:07:06 IIRC, if you're just going to crash on the next li
wjmaclean 2014/08/13 17:16:03 Done.
92 partition->GetHostZoomMap()->SetDefaultZoomLevel(level);
93 }
94
87 } // namespace 95 } // namespace
88 96
89 // static 97 // static
90 void BrowserContext::AsyncObliterateStoragePartition( 98 void BrowserContext::AsyncObliterateStoragePartition(
91 BrowserContext* browser_context, 99 BrowserContext* browser_context,
92 const GURL& site, 100 const GURL& site,
93 const base::Closure& on_gc_required) { 101 const base::Closure& on_gc_required) {
94 GetStoragePartitionMap(browser_context)->AsyncObliterate(site, 102 GetStoragePartitionMap(browser_context)->AsyncObliterate(site,
95 on_gc_required); 103 on_gc_required);
96 } 104 }
97 105
98 // static 106 // static
99 void BrowserContext::GarbageCollectStoragePartitions( 107 void BrowserContext::GarbageCollectStoragePartitions(
100 BrowserContext* browser_context, 108 BrowserContext* browser_context,
101 scoped_ptr<base::hash_set<base::FilePath> > active_paths, 109 scoped_ptr<base::hash_set<base::FilePath> > active_paths,
102 const base::Closure& done) { 110 const base::Closure& done) {
103 GetStoragePartitionMap(browser_context)->GarbageCollect( 111 GetStoragePartitionMap(browser_context)->GarbageCollect(
104 active_paths.Pass(), done); 112 active_paths.Pass(), done);
105 } 113 }
106 114
115 // static
116 void BrowserContext::SetDefaultZoomLevel(BrowserContext* context,
117 double level) {
118 GetStoragePartitionMap(context)->ForEach(
119 base::Bind(ChangeDefaultZoomForStoragePartition, level));
120 }
121
107 DownloadManager* BrowserContext::GetDownloadManager( 122 DownloadManager* BrowserContext::GetDownloadManager(
108 BrowserContext* context) { 123 BrowserContext* context) {
109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 124 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
110 if (!context->GetUserData(kDownloadManagerKeyName)) { 125 if (!context->GetUserData(kDownloadManagerKeyName)) {
111 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); 126 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
112 DCHECK(rdh); 127 DCHECK(rdh);
113 DownloadManager* download_manager = 128 DownloadManager* download_manager =
114 new DownloadManagerImpl( 129 new DownloadManagerImpl(
115 GetContentClient()->browser()->GetNetLog(), context); 130 GetContentClient()->browser()->GetNetLog(), context);
116 131
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 287
273 #endif // !OS_IOS 288 #endif // !OS_IOS
274 289
275 BrowserContext::~BrowserContext() { 290 BrowserContext::~BrowserContext() {
276 #if !defined(OS_IOS) 291 #if !defined(OS_IOS)
277 if (GetUserData(kDownloadManagerKeyName)) 292 if (GetUserData(kDownloadManagerKeyName))
278 GetDownloadManager(this)->Shutdown(); 293 GetDownloadManager(this)->Shutdown();
279 #endif 294 #endif
280 } 295 }
281 296
297 double BrowserContext::GetDefaultZoomLevel() const {
298 return 0;
299 }
300
301 ZoomLevelPrefsDelegate* BrowserContext::CreateZoomLevelPrefsDelegate() {
302 return NULL;
303 }
304
282 } // namespace content 305 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698