| OLD | NEW |
| 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 void BrowserMainParts::SpdyFieldTrial() { | 337 void BrowserMainParts::SpdyFieldTrial() { |
| 338 bool is_spdy_trial = false; | 338 bool is_spdy_trial = false; |
| 339 if (parsed_command_line().HasSwitch(switches::kUseSpdy)) { | 339 if (parsed_command_line().HasSwitch(switches::kUseSpdy)) { |
| 340 std::string spdy_mode = | 340 std::string spdy_mode = |
| 341 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); | 341 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); |
| 342 net::HttpNetworkLayer::EnableSpdy(spdy_mode); | 342 net::HttpNetworkLayer::EnableSpdy(spdy_mode); |
| 343 } else { | 343 } else { |
| 344 const FieldTrial::Probability kSpdyDivisor = 1000; | 344 const FieldTrial::Probability kSpdyDivisor = 1000; |
| 345 // To enable 100% npn_with_spdy, set npnhttp_probability = 0 and set | 345 // To enable 100% npn_with_spdy, set npnhttp_probability = 0 and set |
| 346 // npnspdy_probability = FieldTrial::kAllRemainingProbability. | 346 // npnspdy_probability = FieldTrial::kAllRemainingProbability. |
| 347 // To collect stats, make sure that FieldTrial are distributed among | 347 FieldTrial::Probability npnhttp_probability = 50; |
| 348 // all the three groups: | 348 FieldTrial::Probability npnspdy_probability = 950; |
| 349 // npn_with_spdy : 50%, npn_with_http : 25%, default (no npn, no spdy): 25%. | |
| 350 // a. npn_with_spdy and default: these are used to collect stats for | |
| 351 // alternate protocol with spdy vs. no alternate protocol case. | |
| 352 // b. npn_with_spdy and npn_with_http: these are used to collect stats for | |
| 353 // https vs. https over spdy case. | |
| 354 FieldTrial::Probability npnhttp_probability = 250; | |
| 355 FieldTrial::Probability npnspdy_probability = 500; | |
| 356 scoped_refptr<FieldTrial> trial = | 349 scoped_refptr<FieldTrial> trial = |
| 357 new FieldTrial("SpdyImpact", kSpdyDivisor); | 350 new FieldTrial("SpdyImpact", kSpdyDivisor); |
| 358 // npn with only http support, no spdy. | 351 // npn with only http support, no spdy. |
| 359 int npn_http_grp = | 352 int npn_http_grp = |
| 360 trial->AppendGroup("npn_with_http", npnhttp_probability); | 353 trial->AppendGroup("npn_with_http", npnhttp_probability); |
| 361 // npn with spdy support. | 354 // npn with spdy support. |
| 362 int npn_spdy_grp = | 355 int npn_spdy_grp = |
| 363 trial->AppendGroup("npn_with_spdy", npnspdy_probability); | 356 trial->AppendGroup("npn_with_spdy", npnspdy_probability); |
| 364 int trial_grp = trial->group(); | 357 int trial_grp = trial->group(); |
| 365 if (trial_grp == npn_http_grp) { | 358 if (trial_grp == npn_http_grp) { |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 metrics->Stop(); | 1447 metrics->Stop(); |
| 1455 | 1448 |
| 1456 // browser_shutdown takes care of deleting browser_process, so we need to | 1449 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1457 // release it. | 1450 // release it. |
| 1458 ignore_result(browser_process.release()); | 1451 ignore_result(browser_process.release()); |
| 1459 browser_shutdown::Shutdown(); | 1452 browser_shutdown::Shutdown(); |
| 1460 | 1453 |
| 1461 TRACE_EVENT_END("BrowserMain", 0, 0); | 1454 TRACE_EVENT_END("BrowserMain", 0, 0); |
| 1462 return result_code; | 1455 return result_code; |
| 1463 } | 1456 } |
| OLD | NEW |