Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 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 "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" | 5 #include "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "content/child/child_thread.h" | 13 #include "content/child/child_thread.h" |
| 14 #include "content/common/child_process_messages.h" | 14 #include "content/common/child_process_messages.h" |
| 15 #include "ppapi/proxy/plugin_globals.h" | 15 #include "ppapi/proxy/plugin_globals.h" |
| 16 #include "ppapi/shared_impl/proxy_lock.h" | 16 #include "ppapi/shared_impl/proxy_lock.h" |
| 17 #include "third_party/WebKit/public/platform/WebString.h" | 17 #include "third_party/WebKit/public/platform/WebString.h" |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" | 20 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" |
| 21 #elif defined(OS_MACOSX) | 21 #elif defined(OS_MACOSX) |
| 22 #include "base/mac/mac_util.h" | |
| 22 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 23 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
| 23 #elif defined(OS_ANDROID) | 24 #elif defined(OS_ANDROID) |
| 24 #include "third_party/WebKit/public/platform/android/WebSandboxSupport.h" | 25 #include "third_party/WebKit/public/platform/android/WebSandboxSupport.h" |
| 25 #elif defined(OS_POSIX) | 26 #elif defined(OS_POSIX) |
| 26 #include "content/common/child_process_sandbox_support_impl_linux.h" | 27 #include "content/common/child_process_sandbox_support_impl_linux.h" |
| 27 #include "third_party/WebKit/public/platform/linux/WebFallbackFont.h" | 28 #include "third_party/WebKit/public/platform/linux/WebFallbackFont.h" |
| 28 #include "third_party/WebKit/public/platform/linux/WebSandboxSupport.h" | 29 #include "third_party/WebKit/public/platform/linux/WebSandboxSupport.h" |
| 29 #include "third_party/icu/source/common/unicode/utf16.h" | 30 #include "third_party/icu/source/common/unicode/utf16.h" |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 using blink::WebSandboxSupport; | 33 using blink::WebSandboxSupport; |
| 33 using blink::WebString; | 34 using blink::WebString; |
| 34 using blink::WebUChar; | 35 using blink::WebUChar; |
| 35 using blink::WebUChar32; | 36 using blink::WebUChar32; |
| 36 | 37 |
| 37 typedef struct CGFont* CGFontRef; | 38 typedef struct CGFont* CGFontRef; |
| 38 | 39 |
| 39 namespace content { | 40 namespace content { |
| 40 | 41 |
| 41 class PpapiWebKitPlatformSupportImpl::SandboxSupport | 42 class PpapiWebKitPlatformSupportImpl::SandboxSupport |
| 42 : public WebSandboxSupport { | 43 : public WebSandboxSupport { |
| 43 public: | 44 public: |
| 44 virtual ~SandboxSupport() {} | 45 virtual ~SandboxSupport() {} |
| 45 | 46 |
| 46 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 47 virtual bool ensureFontLoaded(HFONT); | 48 virtual bool ensureFontLoaded(HFONT); |
| 48 #elif defined(OS_MACOSX) | 49 #elif defined(OS_MACOSX) |
| 49 virtual bool loadFont( | 50 virtual bool loadFont( |
| 50 NSFont* srcFont, CGFontRef* out, uint32_t* fontID); | 51 NSFont* srcFont, CGFontRef* out, uint32_t* fontID); |
| 52 virtual CGColorSpaceRef displayColorSpace(); | |
| 51 #elif defined(OS_ANDROID) | 53 #elif defined(OS_ANDROID) |
| 52 // Empty class. | 54 // Empty class. |
| 53 #elif defined(OS_POSIX) | 55 #elif defined(OS_POSIX) |
| 54 SandboxSupport(); | 56 SandboxSupport(); |
| 55 virtual void getFallbackFontForCharacter( | 57 virtual void getFallbackFontForCharacter( |
| 56 WebUChar32 character, | 58 WebUChar32 character, |
| 57 const char* preferred_locale, | 59 const char* preferred_locale, |
| 58 blink::WebFallbackFont* fallbackFont); | 60 blink::WebFallbackFont* fallbackFont); |
| 59 virtual void getRenderStyleForStrike( | 61 virtual void getRenderStyleForStrike( |
| 60 const char* family, int sizeAndStyle, blink::WebFontRenderStyle* out); | 62 const char* family, int sizeAndStyle, blink::WebFontRenderStyle* out); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 88 NSFont* src_font, | 90 NSFont* src_font, |
| 89 CGFontRef* out, | 91 CGFontRef* out, |
| 90 uint32_t* font_id) { | 92 uint32_t* font_id) { |
| 91 // TODO(brettw) this should do the something similar to what | 93 // TODO(brettw) this should do the something similar to what |
| 92 // RendererWebKitClientImpl does and request that the browser load the font. | 94 // RendererWebKitClientImpl does and request that the browser load the font. |
| 93 // Note: need to unlock the proxy lock like ensureFontLoaded does. | 95 // Note: need to unlock the proxy lock like ensureFontLoaded does. |
| 94 NOTIMPLEMENTED(); | 96 NOTIMPLEMENTED(); |
| 95 return false; | 97 return false; |
| 96 } | 98 } |
| 97 | 99 |
| 100 CGColorSpaceRef | |
| 101 PpapiWebKitPlatformSupportImpl::SandboxSupport::displayColorSpace() { | |
| 102 return base::mac::GetSystemColorSpace(); | |
|
Noel Gordon
2014/09/10 07:22:36
Why does ppapi need color profiles? That'd allow
| |
| 103 } | |
| 104 | |
| 98 #elif defined(OS_ANDROID) | 105 #elif defined(OS_ANDROID) |
| 99 | 106 |
| 100 // Empty class. | 107 // Empty class. |
| 101 | 108 |
| 102 #elif defined(OS_POSIX) | 109 #elif defined(OS_POSIX) |
| 103 | 110 |
| 104 PpapiWebKitPlatformSupportImpl::SandboxSupport::SandboxSupport() | 111 PpapiWebKitPlatformSupportImpl::SandboxSupport::SandboxSupport() |
| 105 : creation_thread_(base::PlatformThread::CurrentId()) { | 112 : creation_thread_(base::PlatformThread::CurrentId()) { |
| 106 } | 113 } |
| 107 | 114 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 NOTREACHED(); | 259 NOTREACHED(); |
| 253 } | 260 } |
| 254 | 261 |
| 255 int PpapiWebKitPlatformSupportImpl::databaseDeleteFile( | 262 int PpapiWebKitPlatformSupportImpl::databaseDeleteFile( |
| 256 const blink::WebString& vfs_file_name, bool sync_dir) { | 263 const blink::WebString& vfs_file_name, bool sync_dir) { |
| 257 NOTREACHED(); | 264 NOTREACHED(); |
| 258 return 0; | 265 return 0; |
| 259 } | 266 } |
| 260 | 267 |
| 261 } // namespace content | 268 } // namespace content |
| OLD | NEW |