| 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/base/keygen_handler.h" |
| 16 #include "net/ssl/client_cert_store.h" | 17 #include "net/ssl/client_cert_store.h" |
| 17 | 18 |
| 18 using base::UserDataAdapter; | 19 using base::UserDataAdapter; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 // Key names on ResourceContext. | 25 // Key names on ResourceContext. |
| 25 const char kBlobStorageContextKeyName[] = "content_blob_storage_context"; | 26 const char kBlobStorageContextKeyName[] = "content_blob_storage_context"; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 56 } | 57 } |
| 57 | 58 |
| 58 std::string ResourceContext::GetMediaDeviceIDSalt() { | 59 std::string ResourceContext::GetMediaDeviceIDSalt() { |
| 59 return std::string(); | 60 return std::string(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 scoped_ptr<net::ClientCertStore> ResourceContext::CreateClientCertStore() { | 63 scoped_ptr<net::ClientCertStore> ResourceContext::CreateClientCertStore() { |
| 63 return scoped_ptr<net::ClientCertStore>(); | 64 return scoped_ptr<net::ClientCertStore>(); |
| 64 } | 65 } |
| 65 | 66 |
| 67 scoped_ptr<net::KeygenHandler> ResourceContext::CreateKeygenHandler( |
| 68 uint32 key_size_in_bits, |
| 69 const std::string& challenge_string, |
| 70 const GURL& url, |
| 71 const base::Callback<void(scoped_ptr<net::KeygenHandler>)>& callback) { |
| 72 return scoped_ptr<net::KeygenHandler>( |
| 73 new net::KeygenHandler(key_size_in_bits, challenge_string, url)); |
| 74 } |
| 75 |
| 66 ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( | 76 ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( |
| 67 ResourceContext* resource_context) { | 77 ResourceContext* resource_context) { |
| 68 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 78 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 69 return UserDataAdapter<ChromeBlobStorageContext>::Get( | 79 return UserDataAdapter<ChromeBlobStorageContext>::Get( |
| 70 resource_context, kBlobStorageContextKeyName); | 80 resource_context, kBlobStorageContextKeyName); |
| 71 } | 81 } |
| 72 | 82 |
| 73 StreamContext* GetStreamContextForResourceContext( | 83 StreamContext* GetStreamContextForResourceContext( |
| 74 ResourceContext* resource_context) { | 84 ResourceContext* resource_context) { |
| 75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // store a non-owning pointer here. | 122 // store a non-owning pointer here. |
| 113 resource_context->SetUserData( | 123 resource_context->SetUserData( |
| 114 kHostZoomMapKeyName, | 124 kHostZoomMapKeyName, |
| 115 new NonOwningZoomData( | 125 new NonOwningZoomData( |
| 116 HostZoomMap::GetForBrowserContext(browser_context))); | 126 HostZoomMap::GetForBrowserContext(browser_context))); |
| 117 | 127 |
| 118 resource_context->DetachUserDataThread(); | 128 resource_context->DetachUserDataThread(); |
| 119 } | 129 } |
| 120 | 130 |
| 121 } // namespace content | 131 } // namespace content |
| OLD | NEW |