| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ppapi/proxy/pdf_resource.h" | 5 #include "ppapi/proxy/pdf_resource.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 base::SharedMemoryHandle handle; | 179 base::SharedMemoryHandle handle; |
| 180 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &handle)) | 180 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &handle)) |
| 181 return 0; | 181 return 0; |
| 182 // We always succeed after this point (on non-android platforms, so we don't | 182 // We always succeed after this point (on non-android platforms, so we don't |
| 183 // have to worry about leaking |handle|. | 183 // have to worry about leaking |handle|. |
| 184 | 184 |
| 185 #if defined(OS_ANDROID) | 185 #if defined(OS_ANDROID) |
| 186 // This is compiled into android for tests only. | 186 // This is compiled into android for tests only. |
| 187 return 0; | 187 return 0; |
| 188 #elif defined(OS_WIN) || defined(OS_MACOSX) | 188 #elif defined(TOOLKIT_GTK) |
| 189 return (new ImageData(resource, desc, handle.fd))->GetReference(); |
| 190 #else |
| 189 return (new ImageData(resource, desc, handle))->GetReference(); | 191 return (new ImageData(resource, desc, handle))->GetReference(); |
| 190 #else | |
| 191 return (new ImageData(resource, desc, handle.fd))->GetReference(); | |
| 192 #endif | 192 #endif |
| 193 } | 193 } |
| 194 | 194 |
| 195 PP_Resource PDFResource::GetResourceImage(PP_ResourceImage image_id) { | 195 PP_Resource PDFResource::GetResourceImage(PP_ResourceImage image_id) { |
| 196 return GetResourceImageForScale(image_id, 1.0f); | 196 return GetResourceImageForScale(image_id, 1.0f); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace proxy | 199 } // namespace proxy |
| 200 } // namespace ppapi | 200 } // namespace ppapi |
| OLD | NEW |