Chromium Code Reviews| 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_network_session.h" | 5 #include "net/http/http_network_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/debug/stack_trace.h" | 11 #include "base/debug/stack_trace.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/memory_coordinator_client_registry.h" | 13 #include "base/memory/memory_coordinator_client_registry.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/profiler/scoped_tracker.h" | 15 #include "base/profiler/scoped_tracker.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 19 #include "base/trace_event/memory_allocator_dump.h" | 19 #include "base/trace_event/memory_allocator_dump.h" |
| 20 #include "base/trace_event/memory_dump_request_args.h" | |
| 20 #include "base/trace_event/process_memory_dump.h" | 21 #include "base/trace_event/process_memory_dump.h" |
| 21 #include "base/values.h" | 22 #include "base/values.h" |
| 22 #include "net/base/network_throttle_manager_impl.h" | 23 #include "net/base/network_throttle_manager_impl.h" |
| 23 #include "net/http/http_auth_handler_factory.h" | 24 #include "net/http/http_auth_handler_factory.h" |
| 24 #include "net/http/http_response_body_drainer.h" | 25 #include "net/http/http_response_body_drainer.h" |
| 25 #include "net/http/http_stream_factory_impl.h" | 26 #include "net/http/http_stream_factory_impl.h" |
| 26 #include "net/http/url_security_manager.h" | 27 #include "net/http/url_security_manager.h" |
| 27 #include "net/proxy/proxy_service.h" | 28 #include "net/proxy/proxy_service.h" |
| 28 #include "net/quic/chromium/quic_crypto_client_stream_factory.h" | 29 #include "net/quic/chromium/quic_crypto_client_stream_factory.h" |
| 29 #include "net/quic/chromium/quic_stream_factory.h" | 30 #include "net/quic/chromium/quic_stream_factory.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 *proxy_config = *server_config; | 412 *proxy_config = *server_config; |
| 412 if (request.privacy_mode == PRIVACY_MODE_ENABLED) { | 413 if (request.privacy_mode == PRIVACY_MODE_ENABLED) { |
| 413 server_config->channel_id_enabled = false; | 414 server_config->channel_id_enabled = false; |
| 414 } else if (params_.enable_token_binding && params_.channel_id_service) { | 415 } else if (params_.enable_token_binding && params_.channel_id_service) { |
| 415 server_config->token_binding_params.push_back(TB_PARAM_ECDSAP256); | 416 server_config->token_binding_params.push_back(TB_PARAM_ECDSAP256); |
| 416 } | 417 } |
| 417 } | 418 } |
| 418 | 419 |
| 419 void HttpNetworkSession::DumpMemoryStats( | 420 void HttpNetworkSession::DumpMemoryStats( |
| 420 base::trace_event::ProcessMemoryDump* pmd, | 421 base::trace_event::ProcessMemoryDump* pmd, |
| 422 const base::trace_event::MemoryDumpArgs& args, | |
| 421 const std::string& parent_absolute_name) const { | 423 const std::string& parent_absolute_name) const { |
| 422 std::string name = base::StringPrintf("net/http_network_session_%p", this); | 424 std::string name = base::StringPrintf("net/http_network_session_%p", this); |
| 423 base::trace_event::MemoryAllocatorDump* http_network_session_dump = | 425 base::trace_event::MemoryAllocatorDump* http_network_session_dump = |
| 424 pmd->GetAllocatorDump(name); | 426 pmd->GetAllocatorDump(name); |
| 425 if (http_network_session_dump == nullptr) { | 427 if (http_network_session_dump == nullptr) { |
| 426 http_network_session_dump = pmd->CreateAllocatorDump(name); | 428 http_network_session_dump = pmd->CreateAllocatorDump(name); |
| 427 normal_socket_pool_manager_->DumpMemoryStats( | 429 normal_socket_pool_manager_->DumpMemoryStats( |
| 428 pmd, http_network_session_dump->absolute_name()); | 430 pmd, http_network_session_dump->absolute_name()); |
| 429 spdy_session_pool_.DumpMemoryStats( | 431 spdy_session_pool_.DumpMemoryStats( |
| 430 pmd, http_network_session_dump->absolute_name()); | 432 pmd, http_network_session_dump->absolute_name()); |
| 433 if (args.level_of_detail == | |
|
ssid
2017/01/13 22:23:58
I think your should call this always. Yes it adds
xunjieli
2017/01/17 17:51:23
Done.
| |
| 434 base::trace_event::MemoryDumpLevelOfDetail::DETAILED && | |
| 435 http_stream_factory_) { | |
| 436 http_stream_factory_->DumpMemoryStats( | |
| 437 pmd, http_network_session_dump->absolute_name()); | |
| 438 } | |
| 431 } | 439 } |
| 432 // Create an empty row under parent's dump so size can be attributed correctly | 440 // Create an empty row under parent's dump so size can be attributed correctly |
| 433 // if |this| is shared between URLRequestContexts. | 441 // if |this| is shared between URLRequestContexts. |
| 434 base::trace_event::MemoryAllocatorDump* empty_row_dump = | 442 base::trace_event::MemoryAllocatorDump* empty_row_dump = |
| 435 pmd->CreateAllocatorDump(base::StringPrintf( | 443 pmd->CreateAllocatorDump(base::StringPrintf( |
| 436 "%s/http_network_session", parent_absolute_name.c_str())); | 444 "%s/http_network_session", parent_absolute_name.c_str())); |
| 437 pmd->AddOwnershipEdge(empty_row_dump->guid(), | 445 pmd->AddOwnershipEdge(empty_row_dump->guid(), |
| 438 http_network_session_dump->guid()); | 446 http_network_session_dump->guid()); |
| 439 } | 447 } |
| 440 | 448 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 484 break; | 492 break; |
| 485 case base::MemoryState::SUSPENDED: | 493 case base::MemoryState::SUSPENDED: |
| 486 // Note: Not supported at present. Fall through. | 494 // Note: Not supported at present. Fall through. |
| 487 case base::MemoryState::UNKNOWN: | 495 case base::MemoryState::UNKNOWN: |
| 488 NOTREACHED(); | 496 NOTREACHED(); |
| 489 break; | 497 break; |
| 490 } | 498 } |
| 491 } | 499 } |
| 492 | 500 |
| 493 } // namespace net | 501 } // namespace net |
| OLD | NEW |