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

Side by Side Diff: content/public/browser/browser_main_parts.h

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Temporary - look at browser_list, browser_main_loop, content/p/b/browser_shutdown Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/public/browser/browser_thread.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 // This class contains different "stages" to be executed by |BrowserMain()|, 15 // This class contains different "stages" to be executed by |BrowserMain()|,
15 // Each stage is represented by a single BrowserMainParts method, called from 16 // Each stage is represented by a single BrowserMainParts method, called from
16 // the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization()) 17 // the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization())
17 // which does the following: 18 // which does the following:
18 // - calls a method (e.g., "PreEarlyInitialization()") which implements 19 // - calls a method (e.g., "PreEarlyInitialization()") which implements
19 // platform / tookit specific code for that stage. 20 // platform / tookit specific code for that stage.
20 // - calls various methods for things common to all platforms (for that stage). 21 // - calls various methods for things common to all platforms (for that stage).
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 58
58 virtual void PostEarlyInitialization() = 0; 59 virtual void PostEarlyInitialization() = 0;
59 60
60 virtual void PreMainMessageLoopStart() = 0; 61 virtual void PreMainMessageLoopStart() = 0;
61 62
62 virtual void PostMainMessageLoopStart() = 0; 63 virtual void PostMainMessageLoopStart() = 0;
63 64
64 // Allows an embedder to do any extra toolkit initialization. 65 // Allows an embedder to do any extra toolkit initialization.
65 virtual void ToolkitInitialized() = 0; 66 virtual void ToolkitInitialized() = 0;
66 67
68 // Child threads have not been created at this point.
67 virtual void PreMainMessageLoopRun() = 0; 69 virtual void PreMainMessageLoopRun() = 0;
68 70
71 // The various browser threads have been created at this point.
72 virtual void PreMainMessageLoopRunThreadsCreated() = 0;
73
69 // Returns true if the message loop was run, false otherwise. 74 // Returns true if the message loop was run, false otherwise.
70 // If this returns false, the default implementation will be run. 75 // If this returns false, the default implementation will be run.
71 // May set |result_code|, which will be returned by |BrowserMain()|. 76 // May set |result_code|, which will be returned by |BrowserMain()|.
72 virtual bool MainMessageLoopRun(int* result_code) = 0; 77 virtual bool MainMessageLoopRun(int* result_code) = 0;
73 78
79 // This happens after the main message loop has stopped, but before
80 // threads are stopped.
74 virtual void PostMainMessageLoopRun() = 0; 81 virtual void PostMainMessageLoopRun() = 0;
75 82
83 // Called once for each thread owned by the content framework just
84 // before and just after it is torn down. This is in reverse order
85 // of the threads' appearance in the BrowserThread::ID enumeration.
86 // Note that you will not receive such a call for BrowserThread::UI,
87 // since it is the main thread of the application.
88 virtual void PreStopThread(BrowserThread::ID identifier) = 0;
89 virtual void PostStopThread(BrowserThread::ID identifier) = 0;
90
91 // Called as the very last part of shutdown.
92 virtual void FinalCleanup() = 0;
93
76 private: 94 private:
77 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); 95 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
78 }; 96 };
79 97
80 } // namespace content 98 } // namespace content
81 99
82 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ 100 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698