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

Side by Side Diff: net/spdy/spdy_session.h

Issue 2623803002: Avoid creating MemoryAllocatorDump for individual sockets (Closed)
Patch Set: Address Eric's comments Created 3 years, 11 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/socket/stream_socket.cc ('k') | net/spdy/spdy_session.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 #ifndef NET_SPDY_SPDY_SESSION_H_ 5 #ifndef NET_SPDY_SPDY_SESSION_H_
6 #define NET_SPDY_SPDY_SESSION_H_ 6 #define NET_SPDY_SPDY_SESSION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 29 matching lines...) Expand all
40 #include "net/spdy/spdy_framer.h" 40 #include "net/spdy/spdy_framer.h"
41 #include "net/spdy/spdy_header_block.h" 41 #include "net/spdy/spdy_header_block.h"
42 #include "net/spdy/spdy_protocol.h" 42 #include "net/spdy/spdy_protocol.h"
43 #include "net/spdy/spdy_session_pool.h" 43 #include "net/spdy/spdy_session_pool.h"
44 #include "net/spdy/spdy_stream.h" 44 #include "net/spdy/spdy_stream.h"
45 #include "net/spdy/spdy_write_queue.h" 45 #include "net/spdy/spdy_write_queue.h"
46 #include "net/ssl/ssl_config_service.h" 46 #include "net/ssl/ssl_config_service.h"
47 #include "url/gurl.h" 47 #include "url/gurl.h"
48 #include "url/scheme_host_port.h" 48 #include "url/scheme_host_port.h"
49 49
50 namespace base {
51 namespace trace_event {
52 class ProcessMemoryDump;
53 }
54 }
55
56 namespace net { 50 namespace net {
57 51
58 namespace test { 52 namespace test {
59 class SpdyStreamTest; 53 class SpdyStreamTest;
60 } 54 }
61 55
62 // This is somewhat arbitrary and not really fixed, but it will always work 56 // This is somewhat arbitrary and not really fixed, but it will always work
63 // reasonably with ethernet. Chop the world into 2-packet chunks. This is 57 // reasonably with ethernet. Chop the world into 2-packet chunks. This is
64 // somewhat arbitrary, but is reasonably small and ensures that we elicit 58 // somewhat arbitrary, but is reasonably small and ensures that we elicit
65 // ACKs quickly from TCP (because TCP tries to only ACK every other packet). 59 // ACKs quickly from TCP (because TCP tries to only ACK every other packet).
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // https://http2.github.io/http2-spec/#TLSUsage mandates minimum security 551 // https://http2.github.io/http2-spec/#TLSUsage mandates minimum security
558 // standards for TLS. 552 // standards for TLS.
559 bool HasAcceptableTransportSecurity() const; 553 bool HasAcceptableTransportSecurity() const;
560 554
561 // Must be used only by |pool_|. 555 // Must be used only by |pool_|.
562 base::WeakPtr<SpdySession> GetWeakPtr(); 556 base::WeakPtr<SpdySession> GetWeakPtr();
563 557
564 // HigherLayeredPool implementation: 558 // HigherLayeredPool implementation:
565 bool CloseOneIdleConnection() override; 559 bool CloseOneIdleConnection() override;
566 560
567 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name 561 // Dumps memory allocation stats to |stats|. Sets |*is_session_active| to
568 // used by the parent MemoryAllocatorDump in the memory dump hierarchy. 562 // indicate whether session is active.
569 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, 563 // |stats| can be assumed as being default initialized upon entry.
570 const std::string& parent_dump_absolute_name) const; 564 // Implementation overrides fields in |stats|.
565 void DumpMemoryStats(StreamSocket::SocketMemoryStats* stats,
566 bool* is_session_active) const;
571 567
572 private: 568 private:
573 friend class test::SpdyStreamTest; 569 friend class test::SpdyStreamTest;
574 friend class base::RefCounted<SpdySession>; 570 friend class base::RefCounted<SpdySession>;
575 friend class HttpNetworkTransactionTest; 571 friend class HttpNetworkTransactionTest;
576 friend class HttpProxyClientSocketPoolTest; 572 friend class HttpProxyClientSocketPoolTest;
577 friend class SpdyHttpStreamTest; 573 friend class SpdyHttpStreamTest;
578 friend class SpdyNetworkTransactionTest; 574 friend class SpdyNetworkTransactionTest;
579 friend class SpdyProxyClientSocketTest; 575 friend class SpdyProxyClientSocketTest;
580 friend class SpdySessionTest; 576 friend class SpdySessionTest;
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 // Used for posting asynchronous IO tasks. We use this even though 1208 // Used for posting asynchronous IO tasks. We use this even though
1213 // SpdySession is refcounted because we don't need to keep the SpdySession 1209 // SpdySession is refcounted because we don't need to keep the SpdySession
1214 // alive if the last reference is within a RunnableMethod. Just revoke the 1210 // alive if the last reference is within a RunnableMethod. Just revoke the
1215 // method. 1211 // method.
1216 base::WeakPtrFactory<SpdySession> weak_factory_; 1212 base::WeakPtrFactory<SpdySession> weak_factory_;
1217 }; 1213 };
1218 1214
1219 } // namespace net 1215 } // namespace net
1220 1216
1221 #endif // NET_SPDY_SPDY_SESSION_H_ 1217 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW
« no previous file with comments | « net/socket/stream_socket.cc ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698