| OLD | NEW |
| 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 #include "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "content/public/browser/render_process_host.h" | 39 #include "content/public/browser/render_process_host.h" |
| 40 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
| 41 #include "content/public/common/main_function_params.h" | 41 #include "content/public/common/main_function_params.h" |
| 42 #include "content/public/common/result_codes.h" | 42 #include "content/public/common/result_codes.h" |
| 43 #include "crypto/nss_util.h" | 43 #include "crypto/nss_util.h" |
| 44 #include "media/audio/audio_manager.h" | 44 #include "media/audio/audio_manager.h" |
| 45 #include "net/base/network_change_notifier.h" | 45 #include "net/base/network_change_notifier.h" |
| 46 #include "net/base/ssl_config_service.h" | 46 #include "net/base/ssl_config_service.h" |
| 47 #include "net/socket/client_socket_factory.h" | 47 #include "net/socket/client_socket_factory.h" |
| 48 #include "net/socket/tcp_client_socket.h" | 48 #include "net/socket/tcp_client_socket.h" |
| 49 #include "ui/base/clipboard/clipboard.h" |
| 49 | 50 |
| 50 #if defined(USE_AURA) | 51 #if defined(USE_AURA) |
| 51 #include "content/browser/renderer_host/image_transport_factory.h" | 52 #include "content/browser/renderer_host/image_transport_factory.h" |
| 52 #endif | 53 #endif |
| 53 | 54 |
| 54 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 55 #include <windows.h> | 56 #include <windows.h> |
| 56 #include <commctrl.h> | 57 #include <commctrl.h> |
| 57 #include <shellapi.h> | 58 #include <shellapi.h> |
| 58 | 59 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) | 230 BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
| 230 : parameters_(parameters), | 231 : parameters_(parameters), |
| 231 parsed_command_line_(parameters.command_line), | 232 parsed_command_line_(parameters.command_line), |
| 232 result_code_(content::RESULT_CODE_NORMAL_EXIT) { | 233 result_code_(content::RESULT_CODE_NORMAL_EXIT) { |
| 233 DCHECK(!g_current_browser_main_loop); | 234 DCHECK(!g_current_browser_main_loop); |
| 234 g_current_browser_main_loop = this; | 235 g_current_browser_main_loop = this; |
| 235 } | 236 } |
| 236 | 237 |
| 237 BrowserMainLoop::~BrowserMainLoop() { | 238 BrowserMainLoop::~BrowserMainLoop() { |
| 238 DCHECK_EQ(this, g_current_browser_main_loop); | 239 DCHECK_EQ(this, g_current_browser_main_loop); |
| 240 ui::Clipboard::DestroyClipboards(); |
| 239 g_current_browser_main_loop = NULL; | 241 g_current_browser_main_loop = NULL; |
| 240 } | 242 } |
| 241 | 243 |
| 242 void BrowserMainLoop::Init() { | 244 void BrowserMainLoop::Init() { |
| 243 parts_.reset( | 245 parts_.reset( |
| 244 GetContentClient()->browser()->CreateBrowserMainParts(parameters_)); | 246 GetContentClient()->browser()->CreateBrowserMainParts(parameters_)); |
| 245 } | 247 } |
| 246 | 248 |
| 247 // BrowserMainLoop stages ================================================== | 249 // BrowserMainLoop stages ================================================== |
| 248 | 250 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 698 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 697 if (parameters_.ui_task) | 699 if (parameters_.ui_task) |
| 698 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 700 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
| 699 | 701 |
| 700 base::RunLoop run_loop; | 702 base::RunLoop run_loop; |
| 701 run_loop.Run(); | 703 run_loop.Run(); |
| 702 #endif | 704 #endif |
| 703 } | 705 } |
| 704 | 706 |
| 705 } // namespace content | 707 } // namespace content |
| OLD | NEW |