| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the internal font implementation. | 2 * This file is part of the internal font implementation. |
| 3 * | 3 * |
| 4 * Copyright (c) 2010 Google Inc. All rights reserved. | 4 * Copyright (c) 2010 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 CGFontRef tmpCGFont; | 112 CGFontRef tmpCGFont; |
| 113 uint32_t fontID; | 113 uint32_t fontID; |
| 114 // Send cross-process request to load font. | 114 // Send cross-process request to load font. |
| 115 blink::WebSandboxSupport* sandboxSupport = blink::Platform::current()->sandb
oxSupport(); | 115 blink::WebSandboxSupport* sandboxSupport = blink::Platform::current()->sandb
oxSupport(); |
| 116 if (!sandboxSupport) { | 116 if (!sandboxSupport) { |
| 117 // This function should only be called in response to an error loading a | 117 // This function should only be called in response to an error loading a |
| 118 // font due to being blocked by the sandbox. | 118 // font due to being blocked by the sandbox. |
| 119 // This by definition shouldn't happen if there is no sandbox support. | 119 // This by definition shouldn't happen if there is no sandbox support. |
| 120 ASSERT_NOT_REACHED(); | 120 ASSERT_NOT_REACHED(); |
| 121 return 0; | 121 return nullptr; |
| 122 } | 122 } |
| 123 if (!sandboxSupport->loadFont(nsFont, &tmpCGFont, &fontID)) | 123 if (!sandboxSupport->loadFont(nsFont, &tmpCGFont, &fontID)) |
| 124 return 0; | 124 return nullptr; |
| 125 | 125 |
| 126 RetainPtr<CGFontRef> cgFont(tmpCGFont); | 126 RetainPtr<CGFontRef> cgFont(tmpCGFont); |
| 127 // Now that we have the fontID from the browser process, we can consult | 127 // Now that we have the fontID from the browser process, we can consult |
| 128 // the ID cache. | 128 // the ID cache. |
| 129 font = fontCacheByFontID().get(fontID); | 129 font = fontCacheByFontID().get(fontID); |
| 130 if (font) | 130 if (font) |
| 131 // FIXME: WebSandboxSupport::loadFont() should consult the id cache | 131 // FIXME: WebSandboxSupport::loadFont() should consult the id cache |
| 132 // before activating the font. | 132 // before activating the font. |
| 133 return font; | 133 return font; |
| 134 | 134 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // are consistent. | 198 // are consistent. |
| 199 CFRetain(cgFont); | 199 CFRetain(cgFont); |
| 200 } else { | 200 } else { |
| 201 // If we still can't load the font, set |outNSFont| to null so that
FontPlatformData won't be used. | 201 // If we still can't load the font, set |outNSFont| to null so that
FontPlatformData won't be used. |
| 202 outNSFont = 0; | 202 outNSFont = 0; |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace WebCore | 207 } // namespace WebCore |
| OLD | NEW |