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 "content/ppapi_plugin/ppapi_webkitclient_impl.h" | 5 #include "content/ppapi_plugin/ppapi_webkitclient_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
15 | 15 |
16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebSandboxSupport
.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebSandboxSupport
.h" |
18 #elif defined(OS_MACOSX) | 18 #elif defined(OS_MACOSX) |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSandboxSupport
.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSandboxSupport
.h" |
20 #elif defined(OS_LINUX) | 20 #elif defined(OS_POSIX) |
21 #include "content/common/child_process_sandbox_support_linux.h" | 21 #include "content/common/child_process_sandbox_support_linux.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebSandboxSuppo
rt.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebSandboxSuppo
rt.h" |
23 #endif | 23 #endif |
24 | 24 |
25 using WebKit::WebSandboxSupport; | 25 using WebKit::WebSandboxSupport; |
26 using WebKit::WebString; | 26 using WebKit::WebString; |
27 using WebKit::WebUChar; | 27 using WebKit::WebUChar; |
28 | 28 |
29 class PpapiWebKitClientImpl::SandboxSupport : public WebSandboxSupport { | 29 class PpapiWebKitClientImpl::SandboxSupport : public WebSandboxSupport { |
30 public: | 30 public: |
31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
32 virtual bool ensureFontLoaded(HFONT); | 32 virtual bool ensureFontLoaded(HFONT); |
33 #elif defined(OS_MACOSX) | 33 #elif defined(OS_MACOSX) |
34 virtual bool loadFont(NSFont* srcFont, ATSFontContainerRef* out); | 34 virtual bool loadFont(NSFont* srcFont, ATSFontContainerRef* out); |
35 #elif defined(OS_LINUX) | 35 #elif defined(OS_POSIX) |
36 virtual WebString getFontFamilyForCharacters( | 36 virtual WebString getFontFamilyForCharacters( |
37 const WebUChar* characters, | 37 const WebUChar* characters, |
38 size_t numCharacters, | 38 size_t numCharacters, |
39 const char* preferred_locale); | 39 const char* preferred_locale); |
40 virtual void getRenderStyleForStrike( | 40 virtual void getRenderStyleForStrike( |
41 const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out); | 41 const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out); |
42 | 42 |
43 private: | 43 private: |
44 // WebKit likes to ask us for the correct font family to use for a set of | 44 // WebKit likes to ask us for the correct font family to use for a set of |
45 // unicode code points. It needs this information frequently so we cache it | 45 // unicode code points. It needs this information frequently so we cache it |
(...skipping 16 matching lines...) Expand all Loading... |
62 #elif defined(OS_MACOSX) | 62 #elif defined(OS_MACOSX) |
63 | 63 |
64 bool PpapiWebKitClientImpl::SandboxSupport::loadFont(NSFont* srcFont, | 64 bool PpapiWebKitClientImpl::SandboxSupport::loadFont(NSFont* srcFont, |
65 ATSFontContainerRef* out) { | 65 ATSFontContainerRef* out) { |
66 // TODO(brettw) this should do the something similar to what | 66 // TODO(brettw) this should do the something similar to what |
67 // RendererWebKitClientImpl does and request that the browser load the font. | 67 // RendererWebKitClientImpl does and request that the browser load the font. |
68 NOTIMPLEMENTED(); | 68 NOTIMPLEMENTED(); |
69 return false; | 69 return false; |
70 } | 70 } |
71 | 71 |
72 #elif defined(OS_LINUX) | 72 #elif defined(OS_POSIX) |
73 | 73 |
74 WebString PpapiWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( | 74 WebString PpapiWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( |
75 const WebUChar* characters, | 75 const WebUChar* characters, |
76 size_t num_characters, | 76 size_t num_characters, |
77 const char* preferred_locale) { | 77 const char* preferred_locale) { |
78 base::AutoLock lock(unicode_font_families_mutex_); | 78 base::AutoLock lock(unicode_font_families_mutex_); |
79 const string16 key(characters, num_characters); | 79 const string16 key(characters, num_characters); |
80 const std::map<string16, std::string>::const_iterator iter = | 80 const std::map<string16, std::string>::const_iterator iter = |
81 unicode_font_families_.find(key); | 81 unicode_font_families_.find(key); |
82 if (iter != unicode_font_families_.end()) | 82 if (iter != unicode_font_families_.end()) |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 WebKit::WebSerializedScriptValue | 231 WebKit::WebSerializedScriptValue |
232 PpapiWebKitClientImpl::injectIDBKeyIntoSerializedValue( | 232 PpapiWebKitClientImpl::injectIDBKeyIntoSerializedValue( |
233 const WebKit::WebIDBKey& key, | 233 const WebKit::WebIDBKey& key, |
234 const WebKit::WebSerializedScriptValue& value, | 234 const WebKit::WebSerializedScriptValue& value, |
235 const WebKit::WebString& keyPath) { | 235 const WebKit::WebString& keyPath) { |
236 NOTREACHED(); | 236 NOTREACHED(); |
237 return WebKit::WebSerializedScriptValue(); | 237 return WebKit::WebSerializedScriptValue(); |
238 } | 238 } |
OLD | NEW |