| OLD | NEW |
| 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" |
| 11 #include "content/browser/loader/resource_request_info_impl.h" | 11 #include "content/browser/loader/resource_request_info_impl.h" |
| 12 #include "content/browser/streams/stream_context.h" | 12 #include "content/browser/streams/stream_context.h" |
| 13 #include "content/browser/webui/url_data_manager_backend.h" | 13 #include "content/browser/webui/url_data_manager_backend.h" |
| 14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "net/ssl/client_cert_store.h" |
| 16 | 17 |
| 17 using base::UserDataAdapter; | 18 using base::UserDataAdapter; |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 // Key names on ResourceContext. | 24 // Key names on ResourceContext. |
| 24 const char kBlobStorageContextKeyName[] = "content_blob_storage_context"; | 25 const char kBlobStorageContextKeyName[] = "content_blob_storage_context"; |
| 25 const char kHostZoomMapKeyName[] = "content_host_zoom_map"; | 26 const char kHostZoomMapKeyName[] = "content_host_zoom_map"; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 47 ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get(); | 48 ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get(); |
| 48 if (rdhi) { | 49 if (rdhi) { |
| 49 rdhi->CancelRequestsForContext(this); | 50 rdhi->CancelRequestsForContext(this); |
| 50 rdhi->RemoveResourceContext(this); | 51 rdhi->RemoveResourceContext(this); |
| 51 } | 52 } |
| 52 | 53 |
| 53 // In some tests this object is destructed on UI thread. | 54 // In some tests this object is destructed on UI thread. |
| 54 DetachUserDataThread(); | 55 DetachUserDataThread(); |
| 55 } | 56 } |
| 56 | 57 |
| 58 scoped_ptr<net::ClientCertStore> ResourceContext::GetClientCertStore() { |
| 59 return scoped_ptr<net::ClientCertStore>(); |
| 60 } |
| 61 |
| 57 ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( | 62 ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( |
| 58 ResourceContext* resource_context) { | 63 ResourceContext* resource_context) { |
| 59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 60 return UserDataAdapter<ChromeBlobStorageContext>::Get( | 65 return UserDataAdapter<ChromeBlobStorageContext>::Get( |
| 61 resource_context, kBlobStorageContextKeyName); | 66 resource_context, kBlobStorageContextKeyName); |
| 62 } | 67 } |
| 63 | 68 |
| 64 StreamContext* GetStreamContextForResourceContext( | 69 StreamContext* GetStreamContextForResourceContext( |
| 65 ResourceContext* resource_context) { | 70 ResourceContext* resource_context) { |
| 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // store a non-owning pointer here. | 108 // store a non-owning pointer here. |
| 104 resource_context->SetUserData( | 109 resource_context->SetUserData( |
| 105 kHostZoomMapKeyName, | 110 kHostZoomMapKeyName, |
| 106 new NonOwningZoomData( | 111 new NonOwningZoomData( |
| 107 HostZoomMap::GetForBrowserContext(browser_context))); | 112 HostZoomMap::GetForBrowserContext(browser_context))); |
| 108 | 113 |
| 109 resource_context->DetachUserDataThread(); | 114 resource_context->DetachUserDataThread(); |
| 110 } | 115 } |
| 111 | 116 |
| 112 } // namespace content | 117 } // namespace content |
| OLD | NEW |