OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "chrome/browser/sessions/session_command.h" | 7 #include "chrome/browser/sessions/session_command.h" |
8 | 8 |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 | 10 |
11 SessionCommand::SessionCommand(id_type id, size_type size) | 11 SessionCommand::SessionCommand(id_type id, size_type size) |
(...skipping 11 matching lines...) Expand all Loading... |
23 bool SessionCommand::GetPayload(void* dest, size_t count) const { | 23 bool SessionCommand::GetPayload(void* dest, size_t count) const { |
24 if (size() != count) | 24 if (size() != count) |
25 return false; | 25 return false; |
26 memcpy(dest, &(contents_[0]), count); | 26 memcpy(dest, &(contents_[0]), count); |
27 return true; | 27 return true; |
28 } | 28 } |
29 | 29 |
30 Pickle* SessionCommand::PayloadAsPickle() const { | 30 Pickle* SessionCommand::PayloadAsPickle() const { |
31 return new Pickle(contents(), static_cast<int>(size())); | 31 return new Pickle(contents(), static_cast<int>(size())); |
32 } | 32 } |
OLD | NEW |