| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/renderer_host/sandbox_ipc_linux.h" | 5 #include "content/browser/renderer_host/sandbox_ipc_linux.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <sys/poll.h> | 8 #include <sys/poll.h> |
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 PickleIterator iter, | 216 PickleIterator iter, |
| 217 const std::vector<base::ScopedFD*>& fds) { | 217 const std::vector<base::ScopedFD*>& fds) { |
| 218 // The other side of this call is | 218 // The other side of this call is |
| 219 // content/common/child_process_sandbox_support_impl_linux.cc | 219 // content/common/child_process_sandbox_support_impl_linux.cc |
| 220 | 220 |
| 221 EnsureWebKitInitialized(); | 221 EnsureWebKitInitialized(); |
| 222 WebUChar32 c; | 222 WebUChar32 c; |
| 223 if (!pickle.ReadInt(&iter, &c)) | 223 if (!pickle.ReadInt(&iter, &c)) |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 std::string preferred_locale; | 226 bool hasLocale; |
| 227 if (!pickle.ReadString(&iter, &preferred_locale)) | 227 if (!pickle.ReadBool(&iter, &hasLocale)) |
| 228 return; | 228 return; |
| 229 | 229 |
| 230 blink::WebFallbackFont fallbackFont; | 230 blink::WebFallbackFont fallbackFont; |
| 231 WebFontInfo::fallbackFontForChar(c, preferred_locale.c_str(), &fallbackFont); | 231 if (hasLocale) { |
| 232 std::string preferred_locale; |
| 233 if (!pickle.ReadString(&iter, &preferred_locale)) |
| 234 return; |
| 235 WebFontInfo::fallbackFontForChar( |
| 236 c, preferred_locale.c_str(), &fallbackFont); |
| 237 } else { |
| 238 WebFontInfo::fallbackFontForChar(c, 0, &fallbackFont); |
| 239 } |
| 232 | 240 |
| 233 int pathIndex = FindOrAddPath(SkString(fallbackFont.filename.data())); | 241 int pathIndex = FindOrAddPath(SkString(fallbackFont.filename.data())); |
| 234 fallbackFont.fontconfigInterfaceId = pathIndex; | 242 fallbackFont.fontconfigInterfaceId = pathIndex; |
| 235 | 243 |
| 236 Pickle reply; | 244 Pickle reply; |
| 237 if (fallbackFont.name.data()) { | 245 if (fallbackFont.name.data()) { |
| 238 reply.WriteString(fallbackFont.name.data()); | 246 reply.WriteString(fallbackFont.name.data()); |
| 239 } else { | 247 } else { |
| 240 reply.WriteString(std::string()); | 248 reply.WriteString(std::string()); |
| 241 } | 249 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 418 } |
| 411 | 419 |
| 412 void SandboxIPCHandler::EnsureWebKitInitialized() { | 420 void SandboxIPCHandler::EnsureWebKitInitialized() { |
| 413 if (webkit_platform_support_) | 421 if (webkit_platform_support_) |
| 414 return; | 422 return; |
| 415 webkit_platform_support_.reset(new BlinkPlatformImpl); | 423 webkit_platform_support_.reset(new BlinkPlatformImpl); |
| 416 blink::initializeWithoutV8(webkit_platform_support_.get()); | 424 blink::initializeWithoutV8(webkit_platform_support_.get()); |
| 417 } | 425 } |
| 418 | 426 |
| 419 } // namespace content | 427 } // namespace content |
| OLD | NEW |