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

Side by Side Diff: content/browser/browser_main_loop.h

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_BROWSER_MAIN_LOOP_H_ 5 #ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ 6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "content/browser/browser_process_sub_thread.h" 11 #include "content/browser/browser_process_sub_thread.h"
12 12
13 class CommandLine; 13 class CommandLine;
14 class HighResolutionTimerManager; 14 class HighResolutionTimerManager;
15 class MessageLoop; 15 class MessageLoop;
16 class ResourceDispatcherHost;
16 class SystemMessageWindowWin; 17 class SystemMessageWindowWin;
17 18
18 namespace base { 19 namespace base {
19 class SystemMonitor; 20 class SystemMonitor;
20 } 21 }
21 22
22 namespace net { 23 namespace net {
23 class NetworkChangeNotifier; 24 class NetworkChangeNotifier;
24 } 25 }
25 26
(...skipping 25 matching lines...) Expand all
51 private: 52 private:
52 // For ShutdownThreadsAndCleanUp. 53 // For ShutdownThreadsAndCleanUp.
53 friend class BrowserShutdownImpl; 54 friend class BrowserShutdownImpl;
54 55
55 // Performs the shutdown sequence, starting with PostMainMessageLoopRun 56 // Performs the shutdown sequence, starting with PostMainMessageLoopRun
56 // through stopping threads to PostDestroyThreads. 57 // through stopping threads to PostDestroyThreads.
57 void ShutdownThreadsAndCleanUp(); 58 void ShutdownThreadsAndCleanUp();
58 59
59 void InitializeMainThread(); 60 void InitializeMainThread();
60 61
62 // Called right after the browser threads have been started.
63 void BrowserThreadsStarted();
64
61 // Members initialized on construction --------------------------------------- 65 // Members initialized on construction ---------------------------------------
62 const content::MainFunctionParams& parameters_; 66 const content::MainFunctionParams& parameters_;
63 const CommandLine& parsed_command_line_; 67 const CommandLine& parsed_command_line_;
64 int result_code_; 68 int result_code_;
65 69
66 // Members initialized in |MainMessageLoopStart()| --------------------------- 70 // Members initialized in |MainMessageLoopStart()| ---------------------------
67 scoped_ptr<MessageLoop> main_message_loop_; 71 scoped_ptr<MessageLoop> main_message_loop_;
68 scoped_ptr<base::SystemMonitor> system_monitor_; 72 scoped_ptr<base::SystemMonitor> system_monitor_;
69 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; 73 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_;
70 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; 74 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
71 #if defined(OS_WIN) 75 #if defined(OS_WIN)
72 scoped_ptr<SystemMessageWindowWin> system_message_window_; 76 scoped_ptr<SystemMessageWindowWin> system_message_window_;
73 #endif 77 #endif
74 78
75 // Destroy parts_ before main_message_loop_ (required) and before other 79 // Destroy parts_ before main_message_loop_ (required) and before other
76 // classes constructed in content (but after main_thread_). 80 // classes constructed in content (but after main_thread_).
77 scoped_ptr<BrowserMainParts> parts_; 81 scoped_ptr<BrowserMainParts> parts_;
78 82
79 // Members initialized in |InitializeMainThread()| --------------------------- 83 // Members initialized in |InitializeMainThread()| ---------------------------
80 // This must get destroyed before other threads that are created in parts_. 84 // This must get destroyed before other threads that are created in parts_.
81 scoped_ptr<BrowserThreadImpl> main_thread_; 85 scoped_ptr<BrowserThreadImpl> main_thread_;
82 86
87 // Members initialized in |BrowserThreadsStarted()| --------------------------
88 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_;
89
83 // Members initialized in |RunMainMessageLoopParts()| ------------------------ 90 // Members initialized in |RunMainMessageLoopParts()| ------------------------
84 scoped_ptr<BrowserProcessSubThread> db_thread_; 91 scoped_ptr<BrowserProcessSubThread> db_thread_;
85 scoped_ptr<WebKitThread> webkit_thread_; 92 scoped_ptr<WebKitThread> webkit_thread_;
86 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; 93 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_;
87 scoped_ptr<BrowserProcessSubThread> file_thread_; 94 scoped_ptr<BrowserProcessSubThread> file_thread_;
88 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; 95 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_;
89 scoped_ptr<BrowserProcessSubThread> cache_thread_; 96 scoped_ptr<BrowserProcessSubThread> cache_thread_;
90 scoped_ptr<BrowserProcessSubThread> io_thread_; 97 scoped_ptr<BrowserProcessSubThread> io_thread_;
91 98
92 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); 99 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop);
93 }; 100 };
94 101
95 } // namespace content 102 } // namespace content
96 103
97 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ 104 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698