| Index: chrome/browser/extensions/api/mdns/mdns_api.h
|
| diff --git a/chrome/browser/extensions/api/mdns/mdns_api.h b/chrome/browser/extensions/api/mdns/mdns_api.h
|
| index d5b4e051501211c0be9b2ca946736c19b0c085b2..32a6e706cab30fdea1c3bd8c3c310c53ab1c4f04 100644
|
| --- a/chrome/browser/extensions/api/mdns/mdns_api.h
|
| +++ b/chrome/browser/extensions/api/mdns/mdns_api.h
|
| @@ -45,9 +45,9 @@ class MDnsAPI : public BrowserContextKeyedAPI,
|
| // BrowserContextKeyedAPI implementation.
|
| static BrowserContextKeyedAPIFactory<MDnsAPI>* GetFactoryInstance();
|
|
|
| - // Used to mock out the DnsSdRegistry for testing.
|
| - void SetDnsSdRegistryForTesting(
|
| - std::unique_ptr<media_router::DnsSdRegistry> registry);
|
| + // Used to mock out the DnsSdRegistry for testing. Does not take ownership of
|
| + // |registry|.
|
| + void SetDnsSdRegistryForTesting(media_router::DnsSdRegistry* registry);
|
|
|
| // Immediately issues a multicast DNS query for all service types.
|
| // NOTE: Discovery queries are sent to all event handlers associated with
|
| @@ -112,8 +112,9 @@ class MDnsAPI : public BrowserContextKeyedAPI,
|
| // Ensure methods are only called on UI thread.
|
| base::ThreadChecker thread_checker_;
|
| content::BrowserContext* const browser_context_;
|
| - // Lazily created on first access and destroyed with this API class.
|
| - std::unique_ptr<media_router::DnsSdRegistry> dns_sd_registry_;
|
| + // Raw pointer to a leaky singleton. Lazily created on first access. Must
|
| + // outlive this object.
|
| + media_router::DnsSdRegistry* dns_sd_registry_;
|
| // Count of active listeners per service type, saved from the previous
|
| // invocation of UpdateMDnsListeners().
|
| ServiceTypeCounts prev_service_counts_;
|
|
|