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

Side by Side Diff: net/server/web_socket_encoder.h

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SERVER_WEB_SOCKET_ENCODER_H_ 5 #ifndef NET_SERVER_WEB_SOCKET_ENCODER_H_
6 #define NET_SERVER_WEB_SOCKET_ENCODER_H_ 6 #define NET_SERVER_WEB_SOCKET_ENCODER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 24 matching lines...) Expand all
35 static scoped_ptr<WebSocketEncoder> CreateClient( 35 static scoped_ptr<WebSocketEncoder> CreateClient(
36 const std::string& response_extensions); 36 const std::string& response_extensions);
37 37
38 WebSocket::ParseResult DecodeFrame(const base::StringPiece& frame, 38 WebSocket::ParseResult DecodeFrame(const base::StringPiece& frame,
39 int* bytes_consumed, 39 int* bytes_consumed,
40 std::string* output); 40 std::string* output);
41 void EncodeFrame(const std::string& frame, 41 void EncodeFrame(const std::string& frame,
42 int masking_key, 42 int masking_key,
43 std::string* output); 43 std::string* output);
44 44
45 bool deflate_enabled() const { return deflater_; } 45 bool deflate_enabled() const { return !!deflater_; }
46 46
47 private: 47 private:
48 enum Type { 48 enum Type {
49 FOR_SERVER, 49 FOR_SERVER,
50 FOR_CLIENT, 50 FOR_CLIENT,
51 }; 51 };
52 52
53 WebSocketEncoder(Type type, 53 WebSocketEncoder(Type type,
54 scoped_ptr<WebSocketDeflater> deflater, 54 scoped_ptr<WebSocketDeflater> deflater,
55 scoped_ptr<WebSocketInflater> inflater); 55 scoped_ptr<WebSocketInflater> inflater);
56 56
57 bool Inflate(std::string* message); 57 bool Inflate(std::string* message);
58 bool Deflate(const std::string& message, std::string* output); 58 bool Deflate(const std::string& message, std::string* output);
59 59
60 Type type_; 60 Type type_;
61 scoped_ptr<WebSocketDeflater> deflater_; 61 scoped_ptr<WebSocketDeflater> deflater_;
62 scoped_ptr<WebSocketInflater> inflater_; 62 scoped_ptr<WebSocketInflater> inflater_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(WebSocketEncoder); 64 DISALLOW_COPY_AND_ASSIGN(WebSocketEncoder);
65 }; 65 };
66 66
67 } // namespace net 67 } // namespace net
68 68
69 #endif // NET_SERVER_WEB_SOCKET_ENCODER_H_ 69 #endif // NET_SERVER_WEB_SOCKET_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698