Index: chrome/browser/renderer_host/pepper/device_id_fetcher.h |
diff --git a/chrome/browser/renderer_host/pepper/device_id_fetcher.h b/chrome/browser/renderer_host/pepper/device_id_fetcher.h |
index 1373bdffb236f4ee7e8499500f3a37c0c54b78e8..3a8c80e64edfb577c57dd1a89afc10e6791f9a82 100644 |
--- a/chrome/browser/renderer_host/pepper/device_id_fetcher.h |
+++ b/chrome/browser/renderer_host/pepper/device_id_fetcher.h |
@@ -12,6 +12,7 @@ |
#include "base/compiler_specific.h" |
#include "base/files/file_path.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
#include "ppapi/c/pp_instance.h" |
class Profile; |
@@ -50,23 +51,24 @@ class DeviceIDFetcher : public base::RefCountedThreadSafe<DeviceIDFetcher> { |
~DeviceIDFetcher(); |
// Checks the preferences for DRM (whether DRM is enabled and getting the drm |
- // salt) on the UI thread. These are passed to |ComputeOnIOThread|. |
+ // salt) on the UI thread. |
void CheckPrefsOnUIThread(); |
- // Compute the device ID on the IO thread with the given salt. |
- void ComputeOnIOThread(const std::string& salt); |
+ // Compute the device ID on the UI thread with the given salt and machine ID. |
+ void ComputeOnUIThread(const std::string& salt, |
+ const std::string& machine_id); |
+ |
// Legacy method used to get the device ID for ChromeOS. |
- void ComputeOnBlockingPool(const base::FilePath& profile_path, |
- const std::string& salt); |
+ // static to avoid WeakPtr access on the blocking pool thread. |
+ static void LegacyComputeOnBlockingPool( |
+ base::WeakPtr<DeviceIDFetcher> fetcher, |
+ const base::FilePath& profile_path, |
+ const std::string& salt); |
// Runs the callback passed into Start() on the IO thread with the device ID |
// or the empty string on failure. |
void RunCallbackOnIOThread(const std::string& id); |
- // Helper which returns an ID unique to the system. Returns an empty string if |
- // the call fails. |
- std::string GetMachineID(); |
- |
friend class base::RefCountedThreadSafe<DeviceIDFetcher>; |
// The callback to run when the ID has been fetched. |
@@ -77,6 +79,8 @@ class DeviceIDFetcher : public base::RefCountedThreadSafe<DeviceIDFetcher> { |
int render_process_id_; |
+ base::WeakPtrFactory<DeviceIDFetcher> weak_ptr_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(DeviceIDFetcher); |
}; |