Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | |
| 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 | |
| 11 namespace base { | |
| 12 class SingleThreadTaskRunner; | |
| 13 | |
| 14 namespace trace_event { | |
| 15 class TraceConfig; | |
| 16 } | |
| 17 } | |
| 18 | |
| 19 namespace headless { | |
| 20 class WebContents; | |
| 21 | |
| 22 class HeadlessBrowser { | |
|
Sami
2015/11/19 14:08:34
I think we need a HEADLESS_EXPORT macro on all the
altimin
2015/11/19 14:52:54
Done.
| |
| 23 public: | |
| 24 static HeadlessBrowser* Get(); | |
|
Sami
2015/11/19 14:08:34
Could you add some documentation comments for the
altimin
2015/11/19 14:52:54
Done.
| |
| 25 | |
| 26 virtual WebContents* CreateWebContents(int width, int height) = 0; | |
|
Sami
2015/11/19 14:08:34
Return a scoped_ptr here. gfx::Size instead of wid
altimin
2015/11/19 14:52:54
Done.
| |
| 27 | |
| 28 virtual scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread() = 0; | |
| 29 virtual scoped_refptr<base::SingleThreadTaskRunner> | |
| 30 renderer_main_thread() = 0; | |
| 31 | |
| 32 virtual int Run(int argc, const char** argv) = 0; | |
| 33 virtual void Stop() = 0; | |
| 34 | |
| 35 virtual void OnStart(const base::Closure& on_start_callback) = 0; | |
|
Sami
2015/11/19 14:08:34
Is this something the client would call? Maybe we
altimin
2015/11/19 14:52:54
We want to give user an ability to do some work as
Sami
2015/11/19 15:42:44
Should we just have the user pass this into Run? S
altimin
2015/11/19 16:13:13
Done.
| |
| 36 | |
| 37 virtual void TracingStartRecording( | |
|
Sami
2015/11/19 14:08:34
Probably best to leave tracing out for now since I
altimin
2015/11/19 14:52:54
Done.
| |
| 38 const base::trace_event::TraceConfig& trace_config) = 0; | |
| 39 virtual void TracingStopRecording(const std::string& log_file_name) = 0; | |
| 40 | |
| 41 protected: | |
| 42 virtual ~HeadlessBrowser(){}; | |
|
Sami
2015/11/19 14:08:34
nit: space missing before {} (did you run git cl f
altimin
2015/11/19 14:52:54
Yes! And git cl format does exactly this.
| |
| 43 }; | |
| 44 | |
| 45 } // namespace headless | |
| 46 | |
| 47 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | |
| OLD | NEW |