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 "net/http/http_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/profiler/scoped_tracker.h" |
13 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
18 #include "net/base/connection_type_histograms.h" | 19 #include "net/base/connection_type_histograms.h" |
19 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
20 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
21 #include "net/http/http_basic_stream.h" | 22 #include "net/http/http_basic_stream.h" |
22 #include "net/http/http_network_session.h" | 23 #include "net/http/http_network_session.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 const BoundNetLog& net_log) { | 430 const BoundNetLog& net_log) { |
430 // It is OK to dereference spdy_session_pool, because the | 431 // It is OK to dereference spdy_session_pool, because the |
431 // ClientSocketPoolManager will be destroyed in the same callback that | 432 // ClientSocketPoolManager will be destroyed in the same callback that |
432 // destroys the SpdySessionPool. | 433 // destroys the SpdySessionPool. |
433 return | 434 return |
434 spdy_session_pool->FindAvailableSession(spdy_session_key, net_log) ? | 435 spdy_session_pool->FindAvailableSession(spdy_session_key, net_log) ? |
435 ERR_SPDY_SESSION_ALREADY_EXISTS : OK; | 436 ERR_SPDY_SESSION_ALREADY_EXISTS : OK; |
436 } | 437 } |
437 | 438 |
438 void HttpStreamFactoryImpl::Job::OnIOComplete(int result) { | 439 void HttpStreamFactoryImpl::Job::OnIOComplete(int result) { |
| 440 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455884 is fixed. |
| 441 tracked_objects::ScopedTracker tracking_profile( |
| 442 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 443 "455884 HttpStreamFactoryImpl::Job::OnIOComplete")); |
439 RunLoop(result); | 444 RunLoop(result); |
440 } | 445 } |
441 | 446 |
442 int HttpStreamFactoryImpl::Job::RunLoop(int result) { | 447 int HttpStreamFactoryImpl::Job::RunLoop(int result) { |
443 result = DoLoop(result); | 448 result = DoLoop(result); |
444 | 449 |
445 if (result == ERR_IO_PENDING) | 450 if (result == ERR_IO_PENDING) |
446 return result; | 451 return result; |
447 | 452 |
448 // If there was an error, we should have already resumed the |waiting_job_|, | 453 // If there was an error, we should have already resumed the |waiting_job_|, |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 | 1481 |
1477 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1482 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
1478 HistogramBrokenAlternateProtocolLocation( | 1483 HistogramBrokenAlternateProtocolLocation( |
1479 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1484 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
1480 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1485 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1481 HostPortPair::FromURL(request_info_.url)); | 1486 HostPortPair::FromURL(request_info_.url)); |
1482 } | 1487 } |
1483 } | 1488 } |
1484 | 1489 |
1485 } // namespace net | 1490 } // namespace net |
OLD | NEW |