Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: headless/public/headless_browser.h

Issue 1461693003: [headless] Initial skeleton of headless/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DEPS to correct directory Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: headless/public/headless_browser.h
diff --git a/headless/public/headless_browser.h b/headless/public/headless_browser.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b0f3ae61a5891e6287cb6806e867735c18b67e9
--- /dev/null
+++ b/headless/public/headless_browser.h
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
+#define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+
+namespace trace_event {
+class TraceConfig;
+}
+}
+
+namespace headless {
+class WebContents;
+
+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.
+ public:
+ 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.
+
+ 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.
+
+ virtual scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread() = 0;
+ virtual scoped_refptr<base::SingleThreadTaskRunner>
+ renderer_main_thread() = 0;
+
+ virtual int Run(int argc, const char** argv) = 0;
+ virtual void Stop() = 0;
+
+ 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.
+
+ 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.
+ const base::trace_event::TraceConfig& trace_config) = 0;
+ virtual void TracingStopRecording(const std::string& log_file_name) = 0;
+
+ protected:
+ 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.
+};
+
+} // namespace headless
+
+#endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_

Powered by Google App Engine
This is Rietveld 408576698