OLD | NEW |
---|---|
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 #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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 #include "net/base/network_change_notifier.h" | 101 #include "net/base/network_change_notifier.h" |
102 #include "net/http/http_network_layer.h" | 102 #include "net/http/http_network_layer.h" |
103 #include "net/http/http_stream_factory.h" | 103 #include "net/http/http_stream_factory.h" |
104 #include "net/socket/client_socket_pool_base.h" | 104 #include "net/socket/client_socket_pool_base.h" |
105 #include "net/socket/client_socket_pool_manager.h" | 105 #include "net/socket/client_socket_pool_manager.h" |
106 #include "net/socket/tcp_client_socket.h" | 106 #include "net/socket/tcp_client_socket.h" |
107 #include "net/spdy/spdy_session.h" | 107 #include "net/spdy/spdy_session.h" |
108 #include "net/spdy/spdy_session_pool.h" | 108 #include "net/spdy/spdy_session_pool.h" |
109 #include "net/url_request/url_request.h" | 109 #include "net/url_request/url_request.h" |
110 #include "net/url_request/url_request_throttler_manager.h" | 110 #include "net/url_request/url_request_throttler_manager.h" |
111 #include "net/websockets/websocket_job.h" | |
111 #include "ui/base/l10n/l10n_util.h" | 112 #include "ui/base/l10n/l10n_util.h" |
112 #include "ui/base/resource/resource_bundle.h" | 113 #include "ui/base/resource/resource_bundle.h" |
113 #include "ui/gfx/gl/gl_implementation.h" | 114 #include "ui/gfx/gl/gl_implementation.h" |
114 #include "ui/gfx/gl/gl_switches.h" | 115 #include "ui/gfx/gl/gl_switches.h" |
115 | 116 |
116 #if defined(USE_LINUX_BREAKPAD) | 117 #if defined(USE_LINUX_BREAKPAD) |
117 #include "base/linux_util.h" | 118 #include "base/linux_util.h" |
118 #include "chrome/app/breakpad_linux.h" | 119 #include "chrome/app/breakpad_linux.h" |
119 #endif | 120 #endif |
120 | 121 |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1377 (parsed_command_line.HasSwitch(switches::kApp) || | 1378 (parsed_command_line.HasSwitch(switches::kApp) || |
1378 parsed_command_line.HasSwitch(switches::kAppId) || | 1379 parsed_command_line.HasSwitch(switches::kAppId) || |
1379 parsed_command_line.HasSwitch(switches::kNoFirstRun))) | 1380 parsed_command_line.HasSwitch(switches::kNoFirstRun))) |
1380 first_run_ui_bypass = true; | 1381 first_run_ui_bypass = true; |
1381 } | 1382 } |
1382 | 1383 |
1383 // TODO(viettrungluu): why don't we run this earlier? | 1384 // TODO(viettrungluu): why don't we run this earlier? |
1384 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) | 1385 if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) |
1385 WarnAboutMinimumSystemRequirements(); | 1386 WarnAboutMinimumSystemRequirements(); |
1386 | 1387 |
1387 InitializeNetworkOptions(parsed_command_line); | 1388 InitializeNetworkOptions(parsed_command_line); |
Yuta Kitamura
2011/05/20 08:30:33
Can't you move this to somewhere below about_flags
Takashi Toyoshima
2011/05/20 09:46:52
It could be possible to move ConvertFlagsToSwitch(
| |
1388 | 1389 |
1389 // Initialize histogram synchronizer system. This is a singleton and is used | 1390 // Initialize histogram synchronizer system. This is a singleton and is used |
1390 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of | 1391 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of |
1391 // scope. Even though NewRunnableMethod does AddRef and Release, the object | 1392 // scope. Even though NewRunnableMethod does AddRef and Release, the object |
1392 // will not be deleted after the Task is executed. | 1393 // will not be deleted after the Task is executed. |
1393 scoped_refptr<HistogramSynchronizer> histogram_synchronizer( | 1394 scoped_refptr<HistogramSynchronizer> histogram_synchronizer( |
1394 new HistogramSynchronizer()); | 1395 new HistogramSynchronizer()); |
1395 | 1396 |
1396 // Initialize thread watcher system. This is a singleton and is used by | 1397 // Initialize thread watcher system. This is a singleton and is used by |
1397 // WatchDogThread to keep track of information about threads that are being | 1398 // WatchDogThread to keep track of information about threads that are being |
1398 // watched. | 1399 // watched. |
1399 scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList()); | 1400 scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList()); |
1400 | 1401 |
1401 // Convert active labs into switches. Modifies the current command line. | 1402 // Convert active labs into switches. Modifies the current command line. |
1402 about_flags::ConvertFlagsToSwitches(local_state, | 1403 about_flags::ConvertFlagsToSwitches(local_state, |
1403 CommandLine::ForCurrentProcess()); | 1404 CommandLine::ForCurrentProcess()); |
1404 | 1405 |
1406 // Enable WebSocket over SPDY. | |
1407 // It shluld be set up in InitializeNetworkOptions, but we could not handle | |
Yuta Kitamura
2011/05/20 08:30:33
shluld -> should
Takashi Toyoshima
2011/05/20 09:46:52
This comment is changed for former relocation.
| |
1408 // about:flags there. So We set it up here for the future labs switch. | |
Yuta Kitamura
2011/05/20 08:30:33
We -> we
Takashi Toyoshima
2011/05/20 09:46:52
ditto.
| |
1409 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) | |
1410 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | |
1411 | |
1405 // Now the command line has been mutated based on about:flags, we can | 1412 // Now the command line has been mutated based on about:flags, we can |
1406 // set up metrics and initialize field trials. | 1413 // set up metrics and initialize field trials. |
1407 MetricsService* metrics = parts->SetupMetricsAndFieldTrials( | 1414 MetricsService* metrics = parts->SetupMetricsAndFieldTrials( |
1408 parsed_command_line, local_state); | 1415 parsed_command_line, local_state); |
1409 | 1416 |
1410 // Now that all preferences have been registered, set the install date | 1417 // Now that all preferences have been registered, set the install date |
1411 // for the uninstall metrics if this is our first run. This only actually | 1418 // for the uninstall metrics if this is our first run. This only actually |
1412 // gets used if the user has metrics reporting enabled at uninstall time. | 1419 // gets used if the user has metrics reporting enabled at uninstall time. |
1413 int64 install_date = | 1420 int64 install_date = |
1414 local_state->GetInt64(prefs::kUninstallMetricsInstallDate); | 1421 local_state->GetInt64(prefs::kUninstallMetricsInstallDate); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1949 #if defined(OS_CHROMEOS) | 1956 #if defined(OS_CHROMEOS) |
1950 // To be precise, logout (browser shutdown) is not yet done, but the | 1957 // To be precise, logout (browser shutdown) is not yet done, but the |
1951 // remaining work is negligible, hence we say LogoutDone here. | 1958 // remaining work is negligible, hence we say LogoutDone here. |
1952 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1959 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1953 false); | 1960 false); |
1954 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1961 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1955 #endif | 1962 #endif |
1956 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 1963 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
1957 return result_code; | 1964 return result_code; |
1958 } | 1965 } |
OLD | NEW |