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 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // being torn down (on the IO thread). The current interface that | 70 // being torn down (on the IO thread). The current interface that |
71 // allows using the salt object after ResourceContext has gone away | 71 // allows using the salt object after ResourceContext has gone away |
72 // was put in place to fix http://crbug.com/341211 but I intend to | 72 // was put in place to fix http://crbug.com/341211 but I intend to |
73 // try to figure out how the lifetime should be fixed properly. The | 73 // try to figure out how the lifetime should be fixed properly. The |
74 // original interface was just a method that returns a string. | 74 // original interface was just a method that returns a string. |
75 // | 75 // |
76 // TODO(perkj): Make this method pure virtual when crbug/315022 is | 76 // TODO(perkj): Make this method pure virtual when crbug/315022 is |
77 // fixed. | 77 // fixed. |
78 typedef base::Callback<std::string()> SaltCallback; | 78 typedef base::Callback<std::string()> SaltCallback; |
79 virtual SaltCallback GetMediaDeviceIDSalt(); | 79 virtual SaltCallback GetMediaDeviceIDSalt(); |
| 80 |
| 81 // Utility functions useful for implementations |
| 82 static std::string CreateRandomMediaDeviceIDSalt(); |
| 83 static SaltCallback CreateSaltCallback(const std::string& salt); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace content | 86 } // namespace content |
83 | 87 |
84 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ | 88 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ |
OLD | NEW |