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

Unified Diff: ios/web/public/app/web_main_parts.h

Issue 1149323004: Upstream the iOS web_shell and supporting code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-thread-impl
Patch Set: Address review comments Created 5 years, 7 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 | « ios/web/public/app/web_main_delegate.h ('k') | ios/web/public/app/web_main_parts.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/app/web_main_parts.h
diff --git a/content/public/browser/browser_main_parts.h b/ios/web/public/app/web_main_parts.h
similarity index 56%
copy from content/public/browser/browser_main_parts.h
copy to ios/web/public/app/web_main_parts.h
index d976253944404568276fa588fc0e152a3048cb41..166e9b3f6c47a9a7f64f1f110c9968ab448d4b4f 100644
--- a/content/public/browser/browser_main_parts.h
+++ b/ios/web/public/app/web_main_parts.h
@@ -1,18 +1,17 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 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 CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
-#define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
+#ifndef IOS_WEB_PUBLIC_APP_WEB_MAIN_PARTS_H_
+#define IOS_WEB_PUBLIC_APP_WEB_MAIN_PARTS_H_
#include "base/basictypes.h"
-#include "content/common/content_export.h"
-namespace content {
+namespace web {
-// This class contains different "stages" to be executed by |BrowserMain()|,
-// Each stage is represented by a single BrowserMainParts method, called from
-// the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization())
+// This class contains different "stages" to be executed by |WebMain()|.
+// Each stage is represented by a single WebMainParts method, called from
+// the corresponding method in |WebMainLoop| (e.g., EarlyInitialization())
// which does the following:
// - calls a method (e.g., "PreEarlyInitialization()") which implements
// platform / tookit specific code for that stage.
@@ -25,9 +24,9 @@ namespace content {
// program start (such as setting up signal handlers) and things to be done
// at some generic time before the start of the main message loop.
// - MainMessageLoopStart: things beginning with the start of the main message
-// loop and ending with initialization of the main thread; platform-specific
-// things which should be done immediately before the start of the main
-// message loop should go in |PreMainMessageLoopStart()|.
+// loop and ending with initialization of the main thread; things which
+// should be done immediately before the start of the main message loop
+// should go in |PreMainMessageLoopStart()|.
// - RunMainMessageLoopParts: things to be done before and after invoking the
// main message loop run method (e.g. MessageLoopForUI::current()->Run()).
//
@@ -35,22 +34,15 @@ namespace content {
// - Figure out when your new code should be executed. What must happen
// before/after your code is executed? Are there performance reasons for
// running your code at a particular time? Document these things!
-// - Split out any platform-specific bits. Please avoid #ifdefs it at all
-// possible. You have two choices for platform-specific code: (1) Execute it
-// from one of the platform-specific |Pre/Post...()| methods; do this if the
-// code is unique to a platform type. Or (2) execute it from one of the
-// "parts" (e.g., |EarlyInitialization()|) and provide platform-specific
-// implementations of your code (in a virtual method); do this if you need to
-// provide different implementations across most/all platforms.
// - Unless your new code is just one or two lines, put it into a separate
// method with a well-defined purpose. (Likewise, if you're adding to an
// existing chunk which makes it longer than one or two lines, please move
// the code out into a separate method.)
//
-class CONTENT_EXPORT BrowserMainParts {
+class WebMainParts {
public:
- BrowserMainParts() {}
- virtual ~BrowserMainParts() {}
+ WebMainParts() {}
+ virtual ~WebMainParts() {}
virtual void PreEarlyInitialization() {}
@@ -60,10 +52,7 @@ class CONTENT_EXPORT BrowserMainParts {
virtual void PostMainMessageLoopStart() {}
- // Allows an embedder to do any extra toolkit initialization.
- virtual void ToolkitInitialized() {}
-
- // Called just before any child threads owned by the content
+ // Called just before any child threads owned by the web
// framework are created.
//
// The main message loop has been started at this point (but has not
@@ -75,11 +64,6 @@ class CONTENT_EXPORT BrowserMainParts {
// various browser threads have all been created at this point
virtual void PreMainMessageLoopRun() {}
- // Returns true if the message loop was run, false otherwise.
- // If this returns false, the default implementation will be run.
- // May set |result_code|, which will be returned by |BrowserMain()|.
- virtual bool MainMessageLoopRun(int* result_code);
-
// This happens after the main message loop has stopped, but before
// threads are stopped.
virtual void PostMainMessageLoopRun() {}
@@ -89,6 +73,6 @@ class CONTENT_EXPORT BrowserMainParts {
virtual void PostDestroyThreads() {}
};
-} // namespace content
+} // namespace web
-#endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
+#endif // IOS_WEB_PUBLIC_APP_WEB_MAIN_PARTS_H_
« no previous file with comments | « ios/web/public/app/web_main_delegate.h ('k') | ios/web/public/app/web_main_parts.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698