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

Side by Side Diff: remoting/base/buffered_socket_writer.cc

Issue 2871143003: Adding ThreadChecker statement to d'tor for remoting/base classes (Closed)
Patch Set: Created 3 years, 7 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 | remoting/base/running_samples.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "remoting/base/buffered_socket_writer.h" 5 #include "remoting/base/buffered_socket_writer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 28 matching lines...) Expand all
39 std::unique_ptr<BufferedSocketWriter> BufferedSocketWriter::CreateForSocket( 39 std::unique_ptr<BufferedSocketWriter> BufferedSocketWriter::CreateForSocket(
40 net::Socket* socket, 40 net::Socket* socket,
41 const WriteFailedCallback& write_failed_callback) { 41 const WriteFailedCallback& write_failed_callback) {
42 std::unique_ptr<BufferedSocketWriter> result(new BufferedSocketWriter()); 42 std::unique_ptr<BufferedSocketWriter> result(new BufferedSocketWriter());
43 result->Start(base::Bind(&WriteNetSocket, socket), write_failed_callback); 43 result->Start(base::Bind(&WriteNetSocket, socket), write_failed_callback);
44 return result; 44 return result;
45 } 45 }
46 46
47 BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) {} 47 BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) {}
48 48
49 BufferedSocketWriter::~BufferedSocketWriter() {} 49 BufferedSocketWriter::~BufferedSocketWriter() {
50 DCHECK(thread_checker_.CalledOnValidThread());
51 }
50 52
51 void BufferedSocketWriter::Start( 53 void BufferedSocketWriter::Start(
52 const WriteCallback& write_callback, 54 const WriteCallback& write_callback,
53 const WriteFailedCallback& write_failed_callback) { 55 const WriteFailedCallback& write_failed_callback) {
54 write_callback_ = write_callback; 56 write_callback_ = write_callback;
55 write_failed_callback_ = write_failed_callback; 57 write_failed_callback_ = write_failed_callback;
56 DoWrite(); 58 DoWrite();
57 } 59 }
58 60
59 void BufferedSocketWriter::Write( 61 void BufferedSocketWriter::Write(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DCHECK(write_pending_); 119 DCHECK(write_pending_);
118 write_pending_ = false; 120 write_pending_ = false;
119 121
120 base::WeakPtr<BufferedSocketWriter> self = weak_factory_.GetWeakPtr(); 122 base::WeakPtr<BufferedSocketWriter> self = weak_factory_.GetWeakPtr();
121 HandleWriteResult(result); 123 HandleWriteResult(result);
122 if (self) 124 if (self)
123 DoWrite(); 125 DoWrite();
124 } 126 }
125 127
126 } // namespace remoting 128 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/base/running_samples.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698