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

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: More IWYU, missing link-time dependency for Chrome Frame. 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()") for each member of 19 // - calls a method (e.g., "PreEarlyInitialization()") for each member of
19 // |parts_|. Parts will implement platform or tookit specific code for that 20 // |parts_|. Parts will implement platform or tookit specific code for that
20 // stage. 21 // stage.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 62
62 virtual void PostEarlyInitialization() = 0; 63 virtual void PostEarlyInitialization() = 0;
63 64
64 virtual void PreMainMessageLoopStart() = 0; 65 virtual void PreMainMessageLoopStart() = 0;
65 66
66 // Allows an embedder to do any extra toolkit initialization. 67 // Allows an embedder to do any extra toolkit initialization.
67 virtual void ToolkitInitialized() = 0; 68 virtual void ToolkitInitialized() = 0;
68 69
69 virtual void PostMainMessageLoopStart() = 0; 70 virtual void PostMainMessageLoopStart() = 0;
70 71
72 // Child threads have not been created at this point.
71 virtual void PreMainMessageLoopRun() = 0; 73 virtual void PreMainMessageLoopRun() = 0;
72 74
75 // The various browser threads have been created at this point.
76 virtual void PreMainMessageLoopRunThreadsCreated() = 0;
77
73 // Returns true if the message loop was run, false otherwise. 78 // Returns true if the message loop was run, false otherwise.
74 // May set |result_code|, which will be returned by |BrowserMain()|. 79 // May set |result_code|, which will be returned by |BrowserMain()|.
75 // If no BrowserMainParts implementations return true, the default 80 // If no BrowserMainParts implementations return true, the default
76 // implementation will be run. 81 // implementation will be run.
77 virtual bool MainMessageLoopRun(int* result_code) = 0; 82 virtual bool MainMessageLoopRun(int* result_code) = 0;
78 83
84 // This happens after the main message loop has stopped, but before
85 // threads are stopped.
79 virtual void PostMainMessageLoopRun() = 0; 86 virtual void PostMainMessageLoopRun() = 0;
80 87
88 // Called once for each thread owned by the content framework just
89 // before and just after it is torn down. This is in reverse order
90 // of the threads' appearance in the BrowserThread::ID enumeration,
91 // i.e. the BrowserThread::DB thread goes last.
jam 2011/11/07 21:43:24 nit: personally i'd leave out line 91, since that
Jói 2011/11/18 23:21:44 Good point. Changed to what I was really thinking
92 virtual void PreStopThread(BrowserThread::ID identifier) = 0;
93 virtual void PostStopThread(BrowserThread::ID identifier) = 0;
94
95 // Called as the very last part of shutdown.
96 virtual void FinalCleanup() = 0;
97
81 private: 98 private:
82 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); 99 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
83 }; 100 };
84 101
85 } // namespace content 102 } // namespace content
86 103
87 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ 104 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698