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/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 std::string ResourceContext::GetMediaDeviceIDSalt() { | 41 std::string ResourceContext::GetMediaDeviceIDSalt() { |
42 return media_device_id_salt_; | 42 return media_device_id_salt_; |
43 } | 43 } |
44 | 44 |
45 void ResourceContext::CreateKeygenHandler( | 45 void ResourceContext::CreateKeygenHandler( |
46 uint32_t key_size_in_bits, | 46 uint32_t key_size_in_bits, |
47 const std::string& challenge_string, | 47 const std::string& challenge_string, |
48 const GURL& url, | 48 const GURL& url, |
49 const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { | 49 const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { |
50 callback.Run(base::WrapUnique( | 50 callback.Run(base::MakeUnique<net::KeygenHandler>(key_size_in_bits, |
51 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); | 51 challenge_string, url)); |
52 } | 52 } |
53 | 53 |
54 // static | 54 // static |
55 std::string ResourceContext::CreateRandomMediaDeviceIDSalt() { | 55 std::string ResourceContext::CreateRandomMediaDeviceIDSalt() { |
56 std::string salt; | 56 std::string salt; |
57 base::Base64Encode(base::RandBytesAsString(16), &salt); | 57 base::Base64Encode(base::RandBytesAsString(16), &salt); |
58 DCHECK(!salt.empty()); | 58 DCHECK(!salt.empty()); |
59 return salt; | 59 return salt; |
60 } | 60 } |
61 | 61 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 resource_context->SetUserData( | 95 resource_context->SetUserData( |
96 kStreamContextKeyName, | 96 kStreamContextKeyName, |
97 new UserDataAdapter<StreamContext>( | 97 new UserDataAdapter<StreamContext>( |
98 StreamContext::GetFor(browser_context))); | 98 StreamContext::GetFor(browser_context))); |
99 | 99 |
100 resource_context->DetachUserDataThread(); | 100 resource_context->DetachUserDataThread(); |
101 } | 101 } |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
OLD | NEW |