Chromium Code Reviews| Index: content/shell/browser/shell_content_browser_client.cc |
| diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc |
| index 13210702545de8838a543faf6605534b0a50fa2b..3fff9c22d1b2988fa3148968a78e11185262cfc3 100644 |
| --- a/content/shell/browser/shell_content_browser_client.cc |
| +++ b/content/shell/browser/shell_content_browser_client.cc |
| @@ -122,15 +122,16 @@ int GetCrashSignalFD(const base::CommandLine& command_line) { |
| // A provider of services for Geolocation. |
| class ShellGeolocationDelegate : public content::GeolocationDelegate { |
| public: |
| - explicit ShellGeolocationDelegate(ShellBrowserContext* context) |
| - : context_(context) {} |
| + using GetShellBrowserContextCB = base::Callback<ShellBrowserContext*(void)>; |
| + explicit ShellGeolocationDelegate(GetShellBrowserContextCB get_context_cb) |
| + : get_context_cb_(get_context_cb) {} |
| scoped_refptr<AccessTokenStore> CreateAccessTokenStore() final { |
| - return new ShellAccessTokenStore(context_); |
| + return new ShellAccessTokenStore(get_context_cb_.Run()); |
| } |
| private: |
| - ShellBrowserContext* context_; |
| + GetShellBrowserContextCB get_context_cb_; |
| DISALLOW_COPY_AND_ASSIGN(ShellGeolocationDelegate); |
| }; |
| @@ -371,7 +372,8 @@ ShellBrowserContext* |
| } |
| GeolocationDelegate* ShellContentBrowserClient::CreateGeolocationDelegate() { |
| - return new ShellGeolocationDelegate(browser_context()); |
| + return new ShellGeolocationDelegate(base::Bind( |
| + &ShellContentBrowserClient::browser_context, base::Unretained(this))); |
|
Ken Rockot(use gerrit already)
2016/07/20 20:47:04
This is pretty weird. Why not just get rid of the
mcasas
2016/07/20 20:53:14
Indeed why not! Done.
|
| } |
| } // namespace content |