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

Side by Side Diff: remoting/protocol/util.cc

Issue 8493020: Move code in src/remoting to the new callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: - Created 9 years, 1 month 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 | « remoting/protocol/util.h ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/protocol/util.h" 5 #include "remoting/protocol/util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/hash_tables.h" 8 #include "base/hash_tables.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 17 matching lines...) Expand all
28 // int32 of the serialized message size for framing. 28 // int32 of the serialized message size for framing.
29 const int kExtraBytes = sizeof(int32); 29 const int kExtraBytes = sizeof(int32);
30 int size = msg.ByteSize() + kExtraBytes; 30 int size = msg.ByteSize() + kExtraBytes;
31 scoped_refptr<net::IOBufferWithSize> buffer(new net::IOBufferWithSize(size)); 31 scoped_refptr<net::IOBufferWithSize> buffer(new net::IOBufferWithSize(size));
32 talk_base::SetBE32(buffer->data(), msg.GetCachedSize()); 32 talk_base::SetBE32(buffer->data(), msg.GetCachedSize());
33 msg.SerializeWithCachedSizesToArray( 33 msg.SerializeWithCachedSizesToArray(
34 reinterpret_cast<uint8*>(buffer->data()) + kExtraBytes); 34 reinterpret_cast<uint8*>(buffer->data()) + kExtraBytes);
35 return buffer; 35 return buffer;
36 } 36 }
37 37
38 Task* NewDeleteMessageTask(google::protobuf::MessageLite* message) {
39 return NewRunnableFunction(&DeleteMessage, message);
40 }
41
42 } // namespace protocol 38 } // namespace protocol
43 } // namespace remoting 39 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698