| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/base/clipboard/clipboard.h" | 5 #include "ui/base/clipboard/clipboard.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "gfx/size.h" | 9 #include "ui/gfx/size.h" |
| 10 | 10 |
| 11 namespace ui { | 11 namespace ui { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 // A compromised renderer could send us bad data, so validate it. | 15 // A compromised renderer could send us bad data, so validate it. |
| 16 // This function only checks that the size parameter makes sense, the caller | 16 // This function only checks that the size parameter makes sense, the caller |
| 17 // is responsible for further validating the bitmap buffer against | 17 // is responsible for further validating the bitmap buffer against |
| 18 // |bitmap_bytes|. | 18 // |bitmap_bytes|. |
| 19 // | 19 // |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // UI thread (see DispatchObject()). | 174 // UI thread (see DispatchObject()). |
| 175 iter->second[0].clear(); | 175 iter->second[0].clear(); |
| 176 for (size_t i = 0; i < sizeof(SharedMemory*); ++i) | 176 for (size_t i = 0; i < sizeof(SharedMemory*); ++i) |
| 177 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]); | 177 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]); |
| 178 has_shared_bitmap = true; | 178 has_shared_bitmap = true; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace ui | 183 } // namespace ui |
| OLD | NEW |