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

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

Issue 12093012: Clean up of url data manager classes in content: move URLDataSourceImpl to its own file, move all t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « content/browser/resource_context_impl.h ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/resource_context_impl.h" 5 #include "content/browser/resource_context_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/fileapi/chrome_blob_storage_context.h" 8 #include "content/browser/fileapi/chrome_blob_storage_context.h"
9 #include "content/browser/host_zoom_map_impl.h" 9 #include "content/browser/host_zoom_map_impl.h"
10 #include "content/browser/loader/resource_dispatcher_host_impl.h" 10 #include "content/browser/loader/resource_dispatcher_host_impl.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return UserDataAdapter<ChromeBlobStorageContext>::Get( 58 return UserDataAdapter<ChromeBlobStorageContext>::Get(
59 resource_context, kBlobStorageContextKeyName); 59 resource_context, kBlobStorageContextKeyName);
60 } 60 }
61 61
62 HostZoomMap* GetHostZoomMapForResourceContext(ResourceContext* context) { 62 HostZoomMap* GetHostZoomMapForResourceContext(ResourceContext* context) {
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
64 return static_cast<NonOwningZoomData*>( 64 return static_cast<NonOwningZoomData*>(
65 context->GetUserData(kHostZoomMapKeyName))->host_zoom_map(); 65 context->GetUserData(kHostZoomMapKeyName))->host_zoom_map();
66 } 66 }
67 67
68 ChromeURLDataManagerBackend* GetURLDataManagerForResourceContext( 68 URLDataManagerBackend* GetURLDataManagerForResourceContext(
69 ResourceContext* context) { 69 ResourceContext* context) {
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
71 if (!context->GetUserData(kURLDataManagerBackendKeyName)) { 71 if (!context->GetUserData(kURLDataManagerBackendKeyName)) {
72 context->SetUserData(kURLDataManagerBackendKeyName, 72 context->SetUserData(kURLDataManagerBackendKeyName,
73 new ChromeURLDataManagerBackend()); 73 new URLDataManagerBackend());
74 } 74 }
75 return static_cast<ChromeURLDataManagerBackend*>( 75 return static_cast<URLDataManagerBackend*>(
76 context->GetUserData(kURLDataManagerBackendKeyName)); 76 context->GetUserData(kURLDataManagerBackendKeyName));
77 } 77 }
78 78
79 void InitializeResourceContext(BrowserContext* browser_context) { 79 void InitializeResourceContext(BrowserContext* browser_context) {
80 ResourceContext* resource_context = browser_context->GetResourceContext(); 80 ResourceContext* resource_context = browser_context->GetResourceContext();
81 DCHECK(!resource_context->GetUserData(kHostZoomMapKeyName)); 81 DCHECK(!resource_context->GetUserData(kHostZoomMapKeyName));
82 82
83 resource_context->SetUserData( 83 resource_context->SetUserData(
84 kBlobStorageContextKeyName, 84 kBlobStorageContextKeyName,
85 new UserDataAdapter<ChromeBlobStorageContext>( 85 new UserDataAdapter<ChromeBlobStorageContext>(
86 ChromeBlobStorageContext::GetFor(browser_context))); 86 ChromeBlobStorageContext::GetFor(browser_context)));
87 87
88 // This object is owned by the BrowserContext and not ResourceContext, so 88 // This object is owned by the BrowserContext and not ResourceContext, so
89 // store a non-owning pointer here. 89 // store a non-owning pointer here.
90 resource_context->SetUserData( 90 resource_context->SetUserData(
91 kHostZoomMapKeyName, 91 kHostZoomMapKeyName,
92 new NonOwningZoomData( 92 new NonOwningZoomData(
93 HostZoomMap::GetForBrowserContext(browser_context))); 93 HostZoomMap::GetForBrowserContext(browser_context)));
94 94
95 resource_context->DetachUserDataThread(); 95 resource_context->DetachUserDataThread();
96 } 96 }
97 97
98 } // namespace content 98 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resource_context_impl.h ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698