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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 2802015: Massively simplify the NetworkChangeNotifier infrastructure:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "chrome/common/net/net_resource_provider.h" 71 #include "chrome/common/net/net_resource_provider.h"
72 #include "chrome/common/pref_names.h" 72 #include "chrome/common/pref_names.h"
73 #include "chrome/common/result_codes.h" 73 #include "chrome/common/result_codes.h"
74 #include "chrome/installer/util/google_update_settings.h" 74 #include "chrome/installer/util/google_update_settings.h"
75 #include "chrome/installer/util/master_preferences.h" 75 #include "chrome/installer/util/master_preferences.h"
76 #include "grit/app_locale_settings.h" 76 #include "grit/app_locale_settings.h"
77 #include "grit/chromium_strings.h" 77 #include "grit/chromium_strings.h"
78 #include "grit/generated_resources.h" 78 #include "grit/generated_resources.h"
79 #include "net/base/cookie_monster.h" 79 #include "net/base/cookie_monster.h"
80 #include "net/base/net_module.h" 80 #include "net/base/net_module.h"
81 #include "net/base/network_change_notifier.h"
81 #include "net/http/http_network_layer.h" 82 #include "net/http/http_network_layer.h"
82 #include "net/http/http_network_session.h" 83 #include "net/http/http_network_session.h"
83 #include "net/http/http_network_transaction.h" 84 #include "net/http/http_network_transaction.h"
84 #include "net/socket/client_socket_pool_base.h" 85 #include "net/socket/client_socket_pool_base.h"
85 #include "net/spdy/spdy_session_pool.h" 86 #include "net/spdy/spdy_session_pool.h"
86 87
87 #if defined(OS_POSIX) 88 #if defined(OS_POSIX)
88 // TODO(port): get rid of this include. It's used just to provide declarations 89 // TODO(port): get rid of this include. It's used just to provide declarations
89 // and stub definitions for classes we encouter during the porting effort. 90 // and stub definitions for classes we encouter during the porting effort.
90 #include <errno.h> 91 #include <errno.h>
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 897
897 // Do platform-specific things (such as finishing initializing Cocoa) 898 // Do platform-specific things (such as finishing initializing Cocoa)
898 // prior to instantiating the message loop. This could be turned into a 899 // prior to instantiating the message loop. This could be turned into a
899 // broadcast notification. 900 // broadcast notification.
900 WillInitializeMainMessageLoop(parameters); 901 WillInitializeMainMessageLoop(parameters);
901 902
902 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 903 MessageLoop main_message_loop(MessageLoop::TYPE_UI);
903 904
904 SystemMonitor system_monitor; 905 SystemMonitor system_monitor;
905 HighResolutionTimerManager hi_res_timer_manager; 906 HighResolutionTimerManager hi_res_timer_manager;
907 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier(
908 net::NetworkChangeNotifier::Create());
906 909
907 const char* kThreadName = "CrBrowserMain"; 910 const char* kThreadName = "CrBrowserMain";
908 PlatformThread::SetName(kThreadName); 911 PlatformThread::SetName(kThreadName);
909 main_message_loop.set_thread_name(kThreadName); 912 main_message_loop.set_thread_name(kThreadName);
910 913
911 // Register the main thread by instantiating it, but don't call any methods. 914 // Register the main thread by instantiating it, but don't call any methods.
912 ChromeThread main_thread(ChromeThread::UI, MessageLoop::current()); 915 ChromeThread main_thread(ChromeThread::UI, MessageLoop::current());
913 #if defined(OS_POSIX) 916 #if defined(OS_POSIX)
914 int pipefd[2]; 917 int pipefd[2];
915 int ret = pipe(pipefd); 918 int ret = pipe(pipefd);
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 1452
1450 metrics->Stop(); 1453 metrics->Stop();
1451 1454
1452 // browser_shutdown takes care of deleting browser_process, so we need to 1455 // browser_shutdown takes care of deleting browser_process, so we need to
1453 // release it. 1456 // release it.
1454 ignore_result(browser_process.release()); 1457 ignore_result(browser_process.release());
1455 browser_shutdown::Shutdown(); 1458 browser_shutdown::Shutdown();
1456 1459
1457 return result_code; 1460 return result_code;
1458 } 1461 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698