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

Side by Side Diff: net/http/http_network_session.cc

Issue 2699163002: Whitelist net/ MemoryDumpProvider (Closed)
Patch Set: fix test on windows Created 3 years, 10 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
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <inttypes.h>
8
7 #include <utility> 9 #include <utility>
8 10
9 #include "base/atomic_sequence_num.h" 11 #include "base/atomic_sequence_num.h"
10 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
11 #include "base/debug/stack_trace.h" 13 #include "base/debug/stack_trace.h"
12 #include "base/logging.h" 14 #include "base/logging.h"
13 #include "base/memory/memory_coordinator_client_registry.h" 15 #include "base/memory/memory_coordinator_client_registry.h"
14 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
15 #include "base/profiler/scoped_tracker.h" 17 #include "base/profiler/scoped_tracker.h"
16 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 if (request.privacy_mode == PRIVACY_MODE_ENABLED) { 418 if (request.privacy_mode == PRIVACY_MODE_ENABLED) {
417 server_config->channel_id_enabled = false; 419 server_config->channel_id_enabled = false;
418 } else if (params_.enable_token_binding && params_.channel_id_service) { 420 } else if (params_.enable_token_binding && params_.channel_id_service) {
419 server_config->token_binding_params.push_back(TB_PARAM_ECDSAP256); 421 server_config->token_binding_params.push_back(TB_PARAM_ECDSAP256);
420 } 422 }
421 } 423 }
422 424
423 void HttpNetworkSession::DumpMemoryStats( 425 void HttpNetworkSession::DumpMemoryStats(
424 base::trace_event::ProcessMemoryDump* pmd, 426 base::trace_event::ProcessMemoryDump* pmd,
425 const std::string& parent_absolute_name) const { 427 const std::string& parent_absolute_name) const {
426 std::string name = base::StringPrintf("net/http_network_session_%p", this); 428 std::string name = base::StringPrintf("net/http_network_session_0x%" PRIxPTR,
429 reinterpret_cast<uintptr_t>(this));
427 base::trace_event::MemoryAllocatorDump* http_network_session_dump = 430 base::trace_event::MemoryAllocatorDump* http_network_session_dump =
428 pmd->GetAllocatorDump(name); 431 pmd->GetAllocatorDump(name);
429 if (http_network_session_dump == nullptr) { 432 if (http_network_session_dump == nullptr) {
430 http_network_session_dump = pmd->CreateAllocatorDump(name); 433 http_network_session_dump = pmd->CreateAllocatorDump(name);
431 normal_socket_pool_manager_->DumpMemoryStats( 434 normal_socket_pool_manager_->DumpMemoryStats(
432 pmd, http_network_session_dump->absolute_name()); 435 pmd, http_network_session_dump->absolute_name());
433 spdy_session_pool_.DumpMemoryStats( 436 spdy_session_pool_.DumpMemoryStats(
434 pmd, http_network_session_dump->absolute_name()); 437 pmd, http_network_session_dump->absolute_name());
435 if (http_stream_factory_) { 438 if (http_stream_factory_) {
436 http_stream_factory_->DumpMemoryStats( 439 http_stream_factory_->DumpMemoryStats(
437 pmd, http_network_session_dump->absolute_name()); 440 pmd, http_network_session_dump->absolute_name());
438 } 441 }
439 quic_stream_factory_.DumpMemoryStats( 442 quic_stream_factory_.DumpMemoryStats(
440 pmd, http_network_session_dump->absolute_name()); 443 pmd, http_network_session_dump->absolute_name());
441 } 444 }
445
442 // Create an empty row under parent's dump so size can be attributed correctly 446 // Create an empty row under parent's dump so size can be attributed correctly
443 // if |this| is shared between URLRequestContexts. 447 // if |this| is shared between URLRequestContexts.
444 base::trace_event::MemoryAllocatorDump* empty_row_dump = 448 base::trace_event::MemoryAllocatorDump* empty_row_dump =
445 pmd->CreateAllocatorDump(base::StringPrintf( 449 pmd->CreateAllocatorDump(base::StringPrintf(
446 "%s/http_network_session", parent_absolute_name.c_str())); 450 "%s/http_network_session", parent_absolute_name.c_str()));
447 pmd->AddOwnershipEdge(empty_row_dump->guid(), 451 pmd->AddOwnershipEdge(empty_row_dump->guid(),
448 http_network_session_dump->guid()); 452 http_network_session_dump->guid());
449 } 453 }
450 454
451 bool HttpNetworkSession::IsQuicEnabled() const { 455 bool HttpNetworkSession::IsQuicEnabled() const {
(...skipping 28 matching lines...) Expand all
480 CloseIdleConnections(); 484 CloseIdleConnections();
481 break; 485 break;
482 } 486 }
483 } 487 }
484 488
485 void HttpNetworkSession::OnPurgeMemory() { 489 void HttpNetworkSession::OnPurgeMemory() {
486 CloseIdleConnections(); 490 CloseIdleConnections();
487 } 491 }
488 492
489 } // namespace net 493 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698