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

Side by Side Diff: google_apis/gcm/base/socket_stream.h

Issue 600223003: [GCM] Investigatory CHECKs for crash in parsing stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | google_apis/gcm/base/socket_stream.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Protobuf ZeroCopy[Input/Output]Stream implementations capable of using a 5 // Protobuf ZeroCopy[Input/Output]Stream implementations capable of using a
6 // net::StreamSocket. Built to work with Protobuf CodedStreams. 6 // net::StreamSocket. Built to work with Protobuf CodedStreams.
7 7
8 #ifndef GOOGLE_APIS_GCM_BASE_SOCKET_STREAM_H_ 8 #ifndef GOOGLE_APIS_GCM_BASE_SOCKET_STREAM_H_
9 #define GOOGLE_APIS_GCM_BASE_SOCKET_STREAM_H_ 9 #define GOOGLE_APIS_GCM_BASE_SOCKET_STREAM_H_
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 explicit SocketInputStream(net::StreamSocket* socket); 65 explicit SocketInputStream(net::StreamSocket* socket);
66 virtual ~SocketInputStream(); 66 virtual ~SocketInputStream();
67 67
68 // ZeroCopyInputStream implementation. 68 // ZeroCopyInputStream implementation.
69 virtual bool Next(const void** data, int* size) OVERRIDE; 69 virtual bool Next(const void** data, int* size) OVERRIDE;
70 virtual void BackUp(int count) OVERRIDE; 70 virtual void BackUp(int count) OVERRIDE;
71 virtual bool Skip(int count) OVERRIDE; // Not implemented. 71 virtual bool Skip(int count) OVERRIDE; // Not implemented.
72 virtual int64 ByteCount() const OVERRIDE; 72 virtual int64 ByteCount() const OVERRIDE;
73 73
74 // The remaining amount of valid data available to be read. 74 // The remaining amount of valid data available to be read.
75 size_t UnreadByteCount() const; 75 int UnreadByteCount() const;
76 76
77 // Reads from the socket, appending a max of |byte_limit| bytes onto the read 77 // Reads from the socket, appending a max of |byte_limit| bytes onto the read
78 // buffer. net::ERR_IO_PENDING is returned if the refresh can't complete 78 // buffer. net::ERR_IO_PENDING is returned if the refresh can't complete
79 // synchronously, in which case the callback is invoked upon completion. If 79 // synchronously, in which case the callback is invoked upon completion. If
80 // the refresh can complete synchronously, even in case of an error, returns 80 // the refresh can complete synchronously, even in case of an error, returns
81 // net::OK without invoking callback. 81 // net::OK without invoking callback.
82 // Note: GetState() (and possibly last_error()) should be checked upon 82 // Note: GetState() (and possibly last_error()) should be checked upon
83 // completion to determine whether the Refresh encountered an error. 83 // completion to determine whether the Refresh encountered an error.
84 net::Error Refresh(const base::Closure& callback, int byte_limit); 84 net::Error Refresh(const base::Closure& callback, int byte_limit);
85 85
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 net::Error last_error_; 196 net::Error last_error_;
197 197
198 base::WeakPtrFactory<SocketOutputStream> weak_ptr_factory_; 198 base::WeakPtrFactory<SocketOutputStream> weak_ptr_factory_;
199 199
200 DISALLOW_COPY_AND_ASSIGN(SocketOutputStream); 200 DISALLOW_COPY_AND_ASSIGN(SocketOutputStream);
201 }; 201 };
202 202
203 } // namespace gcm 203 } // namespace gcm
204 204
205 #endif // GOOGLE_APIS_GCM_BASE_SOCKET_STREAM_H_ 205 #endif // GOOGLE_APIS_GCM_BASE_SOCKET_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/base/socket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698