| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // Returns the HeadlessWebContents associated with the | 49 // Returns the HeadlessWebContents associated with the |
| 50 // |devtools_agent_host_id| if any. Otherwise returns null. | 50 // |devtools_agent_host_id| if any. Otherwise returns null. |
| 51 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( | 51 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( |
| 52 const std::string& devtools_agent_host_id) = 0; | 52 const std::string& devtools_agent_host_id) = 0; |
| 53 | 53 |
| 54 // Returns HeadlessBrowserContext associated with the given id if any. | 54 // Returns HeadlessBrowserContext associated with the given id if any. |
| 55 // Otherwise returns null. | 55 // Otherwise returns null. |
| 56 virtual HeadlessBrowserContext* GetBrowserContextForId( | 56 virtual HeadlessBrowserContext* GetBrowserContextForId( |
| 57 const std::string& id) = 0; | 57 const std::string& id) = 0; |
| 58 | 58 |
| 59 // Allows setting and getting the browser context that DevTools will create |
| 60 // new targets in by default. |
| 61 virtual void SetDefaultBrowserContext( |
| 62 HeadlessBrowserContext* browser_context) = 0; |
| 63 virtual HeadlessBrowserContext* GetDefaultBrowserContext() = 0; |
| 64 |
| 59 // Returns a task runner for submitting work to the browser file thread. | 65 // Returns a task runner for submitting work to the browser file thread. |
| 60 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() | 66 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() |
| 61 const = 0; | 67 const = 0; |
| 62 | 68 |
| 63 // Returns a task runner for submitting work to the browser io thread. | 69 // Returns a task runner for submitting work to the browser io thread. |
| 64 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserIOThread() | 70 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserIOThread() |
| 65 const = 0; | 71 const = 0; |
| 66 | 72 |
| 67 // Returns a task runner for submitting work to the browser main thread. | 73 // Returns a task runner for submitting work to the browser main thread. |
| 68 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() | 74 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // the main loop, it will only return after HeadlessBrowser::Shutdown() is | 216 // the main loop, it will only return after HeadlessBrowser::Shutdown() is |
| 211 // called, returning the exit code for the process. It is not possible to | 217 // called, returning the exit code for the process. It is not possible to |
| 212 // initialize the browser again after it has been torn down. | 218 // initialize the browser again after it has been torn down. |
| 213 int HeadlessBrowserMain( | 219 int HeadlessBrowserMain( |
| 214 HeadlessBrowser::Options options, | 220 HeadlessBrowser::Options options, |
| 215 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); | 221 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); |
| 216 | 222 |
| 217 } // namespace headless | 223 } // namespace headless |
| 218 | 224 |
| 219 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 225 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| OLD | NEW |