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

Side by Side Diff: ui/base/clipboard/clipboard.cc

Issue 8801038: Make Clipboard::FormatType an opaque handle type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_aurax11.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 (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/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
10 10
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 *reinterpret_cast<SharedMemory**>(raw_bitmap_data)); 135 *reinterpret_cast<SharedMemory**>(raw_bitmap_data));
136 136
137 if (!ValidateAndMapSharedBitmap(params, bitmap_data.get())) 137 if (!ValidateAndMapSharedBitmap(params, bitmap_data.get()))
138 return; 138 return;
139 WriteBitmap(static_cast<const char*>(bitmap_data->memory()), 139 WriteBitmap(static_cast<const char*>(bitmap_data->memory()),
140 &(params[1].front())); 140 &(params[1].front()));
141 break; 141 break;
142 } 142 }
143 143
144 case CBF_DATA: 144 case CBF_DATA:
145 WriteData(&(params[0].front()), params[0].size(), 145 WriteData(
146 &(params[1].front()), params[1].size()); 146 FormatType::Deserialize(
147 std::string(&(params[0].front()), params[0].size())),
148 &(params[1].front()),
149 params[1].size());
147 break; 150 break;
148 151
149 default: 152 default:
150 NOTREACHED(); 153 NOTREACHED();
151 } 154 }
152 } 155 }
153 156
154 // static 157 // static
155 void Clipboard::ReplaceSharedMemHandle(ObjectMap* objects, 158 void Clipboard::ReplaceSharedMemHandle(ObjectMap* objects,
156 base::SharedMemoryHandle bitmap_handle, 159 base::SharedMemoryHandle bitmap_handle,
(...skipping 19 matching lines...) Expand all
176 // UI thread (see DispatchObject()). 179 // UI thread (see DispatchObject()).
177 iter->second[0].clear(); 180 iter->second[0].clear();
178 for (size_t i = 0; i < sizeof(SharedMemory*); ++i) 181 for (size_t i = 0; i < sizeof(SharedMemory*); ++i)
179 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]); 182 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]);
180 has_shared_bitmap = true; 183 has_shared_bitmap = true;
181 } 184 }
182 } 185 }
183 } 186 }
184 187
185 } // namespace ui 188 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698