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

Side by Side Diff: content/child/web_socket_stream_handle_impl.cc

Issue 671663002: Standardize usage of virtual/override/final in content/ (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 | « content/child/threaded_data_provider.cc ('k') | content/child/web_url_loader_impl.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 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 // An implementation of WebSocketStreamHandle. 5 // An implementation of WebSocketStreamHandle.
6 6
7 #include "content/child/web_socket_stream_handle_impl.h" 7 #include "content/child/web_socket_stream_handle_impl.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 void Connect(const WebURL& url); 46 void Connect(const WebURL& url);
47 bool Send(const WebData& data); 47 bool Send(const WebData& data);
48 void Close(); 48 void Close();
49 49
50 // Must be called before |handle_| or |client_| is deleted. 50 // Must be called before |handle_| or |client_| is deleted.
51 // Once detached, it never calls |client_| back. 51 // Once detached, it never calls |client_| back.
52 void Detach(); 52 void Detach();
53 53
54 // WebSocketStreamHandleDelegate methods: 54 // WebSocketStreamHandleDelegate methods:
55 virtual void DidOpenStream(WebSocketStreamHandle*, int) override; 55 void DidOpenStream(WebSocketStreamHandle*, int) override;
56 virtual void DidSendData(WebSocketStreamHandle*, int) override; 56 void DidSendData(WebSocketStreamHandle*, int) override;
57 virtual void DidReceiveData(WebSocketStreamHandle*, 57 void DidReceiveData(WebSocketStreamHandle*, const char*, int) override;
58 const char*, 58 void DidClose(WebSocketStreamHandle*) override;
59 int) override; 59 void DidFail(WebSocketStreamHandle*, int, const base::string16&) override;
60 virtual void DidClose(WebSocketStreamHandle*) override;
61 virtual void DidFail(WebSocketStreamHandle*,
62 int,
63 const base::string16&) override;
64 60
65 private: 61 private:
66 friend class base::RefCounted<Context>; 62 friend class base::RefCounted<Context>;
67 virtual ~Context() { 63 ~Context() override {
68 DCHECK(!handle_); 64 DCHECK(!handle_);
69 DCHECK(!client_); 65 DCHECK(!client_);
70 DCHECK(!bridge_.get()); 66 DCHECK(!bridge_.get());
71 } 67 }
72 68
73 WebSocketStreamHandleImpl* handle_; 69 WebSocketStreamHandleImpl* handle_;
74 WebSocketStreamHandleClient* client_; 70 WebSocketStreamHandleClient* client_;
75 // |bridge_| is alive from Connect to DidClose, so Context must be alive 71 // |bridge_| is alive from Connect to DidClose, so Context must be alive
76 // in the time period. 72 // in the time period.
77 scoped_refptr<WebSocketStreamHandleBridge> bridge_; 73 scoped_refptr<WebSocketStreamHandleBridge> bridge_;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 185
190 bool WebSocketStreamHandleImpl::send(const WebData& data) { 186 bool WebSocketStreamHandleImpl::send(const WebData& data) {
191 return context_->Send(data); 187 return context_->Send(data);
192 } 188 }
193 189
194 void WebSocketStreamHandleImpl::close() { 190 void WebSocketStreamHandleImpl::close() {
195 context_->Close(); 191 context_->Close();
196 } 192 }
197 193
198 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « content/child/threaded_data_provider.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698