OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file provides the embedder's side of random webkit glue functions. | 5 // This file provides the embedder's side of random webkit glue functions. |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <wininet.h> | 8 #include <wininet.h> |
9 | 9 |
10 #include "base/clipboard.h" | 10 #include "base/clipboard.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 NOTREACHED(); | 88 NOTREACHED(); |
89 return; | 89 return; |
90 } | 90 } |
91 | 91 |
92 // Copy the bits into shared memory | 92 // Copy the bits into shared memory |
93 SkAutoLockPixels bitmap_lock(bitmap); | 93 SkAutoLockPixels bitmap_lock(bitmap); |
94 memcpy(shared_buf_->memory(), bitmap.getPixels(), buf_size); | 94 memcpy(shared_buf_->memory(), bitmap.getPixels(), buf_size); |
95 shared_buf_->Unmap(); | 95 shared_buf_->Unmap(); |
96 | 96 |
97 Clipboard::ObjectMapParam param1, param2; | 97 Clipboard::ObjectMapParam param1, param2; |
98 SharedMemoryHandle smh = shared_buf_->handle(); | 98 base::SharedMemoryHandle smh = shared_buf_->handle(); |
99 | 99 |
100 const char* shared_handle = reinterpret_cast<const char*>(&smh); | 100 const char* shared_handle = reinterpret_cast<const char*>(&smh); |
101 for (size_t i = 0; i < sizeof SharedMemoryHandle; i++) | 101 for (size_t i = 0; i < sizeof base::SharedMemoryHandle; i++) |
102 param1.push_back(shared_handle[i]); | 102 param1.push_back(shared_handle[i]); |
103 | 103 |
104 const char* size_data = reinterpret_cast<const char*>(&size); | 104 const char* size_data = reinterpret_cast<const char*>(&size); |
105 for (size_t i = 0; i < sizeof gfx::Size; i++) | 105 for (size_t i = 0; i < sizeof gfx::Size; i++) |
106 param2.push_back(size_data[i]); | 106 param2.push_back(size_data[i]); |
107 | 107 |
108 Clipboard::ObjectMapParams params; | 108 Clipboard::ObjectMapParams params; |
109 params.push_back(param1); | 109 params.push_back(param1); |
110 params.push_back(param2); | 110 params.push_back(param2); |
111 objects_[Clipboard::CBF_SMBITMAP] = params; | 111 objects_[Clipboard::CBF_SMBITMAP] = params; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // NOTE: Since this can be called from the plugin process, we might not have | 312 // NOTE: Since this can be called from the plugin process, we might not have |
313 // a RenderThread. Do nothing in that case. | 313 // a RenderThread. Do nothing in that case. |
314 if (RenderThread::current()) | 314 if (RenderThread::current()) |
315 RenderThread::current()->InformHostOfCacheStatsLater(); | 315 RenderThread::current()->InformHostOfCacheStatsLater(); |
316 } | 316 } |
317 | 317 |
318 #endif // !USING_SIMPLE_RESOURCE_LOADER_BRIDGE | 318 #endif // !USING_SIMPLE_RESOURCE_LOADER_BRIDGE |
319 | 319 |
320 } // namespace webkit_glue | 320 } // namespace webkit_glue |
321 | 321 |
OLD | NEW |