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

Unified Diff: content/public/app/content_main.h

Issue 190853004: Convert ContentMain to take a struct instead of parameters that vary depending on the platform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 9 months 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
« no previous file with comments | « content/app/content_main_runner.cc ('k') | content/public/app/content_main_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/app/content_main.h
===================================================================
--- content/public/app/content_main.h (revision 255735)
+++ content/public/app/content_main.h (working copy)
@@ -5,6 +5,8 @@
#ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_H_
#define CONTENT_PUBLIC_APP_CONTENT_MAIN_H_
+#include <stddef.h>
+
#include "build/build_config.h"
#include "content/common/content_export.h"
@@ -17,21 +19,36 @@
}
namespace content {
-
class ContentMainDelegate;
-// ContentMain should be called from the embedder's main() function to do the
-// initial setup for every process. The embedder has a chance to customize
-// startup using the ContentMainDelegate interface. The embedder can also pass
-// in NULL for |delegate| if they don't want to override default startup.
+struct ContentMainParams {
+ explicit ContentMainParams(ContentMainDelegate* delegate)
+ : delegate(delegate)
#if defined(OS_WIN)
+ , instance(NULL),
+ sandbox_info(NULL)
+#elif !defined(OS_ANDROID)
+ , argc(0),
+ argv(NULL)
+#endif
+ {
+ }
-// |sandbox_info| should be initialized using InitializeSandboxInfo from
-// content_main_win.h
-CONTENT_EXPORT int ContentMain(HINSTANCE instance,
- sandbox::SandboxInterfaceInfo* sandbox_info,
- ContentMainDelegate* delegate);
-#elif defined(OS_ANDROID)
+ ContentMainDelegate* delegate;
+
+#if defined(OS_WIN)
+ HINSTANCE instance;
+
+ // |sandbox_info| should be initialized using InitializeSandboxInfo from
+ // content_main_win.h
+ sandbox::SandboxInterfaceInfo* sandbox_info;
+#elif !defined(OS_ANDROID)
+ int argc;
+ const char** argv;
+#endif
+};
+
+#if defined(OS_ANDROID)
// In the Android, the content main starts from ContentMain.java, This function
// provides a way to set the |delegate| as ContentMainDelegate for
// ContentMainRunner.
@@ -39,10 +56,12 @@
// The ownership of |delegate| is transferred.
CONTENT_EXPORT void SetContentMainDelegate(ContentMainDelegate* delegate);
#else
-CONTENT_EXPORT int ContentMain(int argc,
- const char** argv,
- ContentMainDelegate* delegate);
-#endif // defined(OS_WIN)
+// ContentMain should be called from the embedder's main() function to do the
+// initial setup for every process. The embedder has a chance to customize
+// startup using the ContentMainDelegate interface. The embedder can also pass
+// in NULL for |delegate| if they don't want to override default startup.
+CONTENT_EXPORT int ContentMain(const ContentMainParams& params);
+#endif
} // namespace content
« no previous file with comments | « content/app/content_main_runner.cc ('k') | content/public/app/content_main_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698