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

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

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: rebased 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/spdy/spdy_header_block.cc ('k') | net/spdy/spdy_session.h » ('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 // This file contains some protocol structures for use with SPDY 3 and HTTP 2 5 // This file contains some protocol structures for use with SPDY 3 and HTTP 2
6 // The SPDY 3 spec can be found at: 6 // The SPDY 3 spec can be found at:
7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3
8 8
9 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ 9 #ifndef NET_SPDY_SPDY_PROTOCOL_H_
10 #define NET_SPDY_SPDY_PROTOCOL_H_ 10 #define NET_SPDY_SPDY_PROTOCOL_H_
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 owns_buffer_ = false; 855 owns_buffer_ = false;
856 } else { 856 } else {
857 // Otherwise, we need to make a copy to give to the caller. 857 // Otherwise, we need to make a copy to give to the caller.
858 buffer = new char[size_]; 858 buffer = new char[size_];
859 memcpy(buffer, frame_, size_); 859 memcpy(buffer, frame_, size_);
860 } 860 }
861 *this = SpdySerializedFrame(); 861 *this = SpdySerializedFrame();
862 return buffer; 862 return buffer;
863 } 863 }
864 864
865 // Returns the estimate of dynamically allocated memory in bytes.
866 size_t EstimateMemoryUsage() const { return owns_buffer_ ? size_ : 0; }
867
865 protected: 868 protected:
866 char* frame_; 869 char* frame_;
867 870
868 private: 871 private:
869 size_t size_; 872 size_t size_;
870 bool owns_buffer_; 873 bool owns_buffer_;
871 DISALLOW_COPY_AND_ASSIGN(SpdySerializedFrame); 874 DISALLOW_COPY_AND_ASSIGN(SpdySerializedFrame);
872 }; 875 };
873 876
874 // This interface is for classes that want to process SpdyFrameIRs without 877 // This interface is for classes that want to process SpdyFrameIRs without
(...skipping 19 matching lines...) Expand all
894 SpdyFrameVisitor() {} 897 SpdyFrameVisitor() {}
895 virtual ~SpdyFrameVisitor() {} 898 virtual ~SpdyFrameVisitor() {}
896 899
897 private: 900 private:
898 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); 901 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor);
899 }; 902 };
900 903
901 } // namespace net 904 } // namespace net
902 905
903 #endif // NET_SPDY_SPDY_PROTOCOL_H_ 906 #endif // NET_SPDY_SPDY_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_header_block.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698