| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ptr_util.h" |
| 11 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 12 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| 12 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 13 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 13 #include "content/browser/loader/resource_request_info_impl.h" | 14 #include "content/browser/loader/resource_request_info_impl.h" |
| 14 #include "content/browser/streams/stream_context.h" | 15 #include "content/browser/streams/stream_context.h" |
| 15 #include "content/browser/webui/url_data_manager_backend.h" | 16 #include "content/browser/webui/url_data_manager_backend.h" |
| 16 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
| 17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 #include "net/base/keygen_handler.h" | 19 #include "net/base/keygen_handler.h" |
| 19 #include "net/ssl/client_cert_store.h" | 20 #include "net/ssl/client_cert_store.h" |
| 20 | 21 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 56 } |
| 56 | 57 |
| 57 // In some tests this object is destructed on UI thread. | 58 // In some tests this object is destructed on UI thread. |
| 58 DetachUserDataThread(); | 59 DetachUserDataThread(); |
| 59 } | 60 } |
| 60 | 61 |
| 61 ResourceContext::SaltCallback ResourceContext::GetMediaDeviceIDSalt() { | 62 ResourceContext::SaltCallback ResourceContext::GetMediaDeviceIDSalt() { |
| 62 return base::Bind(&ReturnEmptySalt); | 63 return base::Bind(&ReturnEmptySalt); |
| 63 } | 64 } |
| 64 | 65 |
| 65 scoped_ptr<net::ClientCertStore> ResourceContext::CreateClientCertStore() { | 66 std::unique_ptr<net::ClientCertStore> ResourceContext::CreateClientCertStore() { |
| 66 return scoped_ptr<net::ClientCertStore>(); | 67 return std::unique_ptr<net::ClientCertStore>(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 void ResourceContext::CreateKeygenHandler( | 70 void ResourceContext::CreateKeygenHandler( |
| 70 uint32_t key_size_in_bits, | 71 uint32_t key_size_in_bits, |
| 71 const std::string& challenge_string, | 72 const std::string& challenge_string, |
| 72 const GURL& url, | 73 const GURL& url, |
| 73 const base::Callback<void(scoped_ptr<net::KeygenHandler>)>& callback) { | 74 const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { |
| 74 callback.Run(make_scoped_ptr( | 75 callback.Run(base::WrapUnique( |
| 75 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); | 76 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); |
| 76 } | 77 } |
| 77 | 78 |
| 78 ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( | 79 ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( |
| 79 const ResourceContext* resource_context) { | 80 const ResourceContext* resource_context) { |
| 80 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 81 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 81 return UserDataAdapter<ChromeBlobStorageContext>::Get( | 82 return UserDataAdapter<ChromeBlobStorageContext>::Get( |
| 82 resource_context, kBlobStorageContextKeyName); | 83 resource_context, kBlobStorageContextKeyName); |
| 83 } | 84 } |
| 84 | 85 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 110 | 111 |
| 111 resource_context->SetUserData( | 112 resource_context->SetUserData( |
| 112 kStreamContextKeyName, | 113 kStreamContextKeyName, |
| 113 new UserDataAdapter<StreamContext>( | 114 new UserDataAdapter<StreamContext>( |
| 114 StreamContext::GetFor(browser_context))); | 115 StreamContext::GetFor(browser_context))); |
| 115 | 116 |
| 116 resource_context->DetachUserDataThread(); | 117 resource_context->DetachUserDataThread(); |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace content | 120 } // namespace content |
| OLD | NEW |