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/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 uint32_t font_data_size; | 542 uint32_t font_data_size; |
543 FontDescriptor src_font_descriptor(src_font); | 543 FontDescriptor src_font_descriptor(src_font); |
544 base::SharedMemoryHandle font_data; | 544 base::SharedMemoryHandle font_data; |
545 if (!RenderThread::Get()->Send(new RenderProcessHostMsg_LoadFont( | 545 if (!RenderThread::Get()->Send(new RenderProcessHostMsg_LoadFont( |
546 src_font_descriptor, &font_data_size, &font_data, font_id))) { | 546 src_font_descriptor, &font_data_size, &font_data, font_id))) { |
547 *out = NULL; | 547 *out = NULL; |
548 *font_id = 0; | 548 *font_id = 0; |
549 return false; | 549 return false; |
550 } | 550 } |
551 | 551 |
552 if (font_data_size == 0 || font_data == base::SharedMemory::NULLHandle() || | 552 if (font_data_size == 0 || !font_data.IsValid() || *font_id == 0) { |
553 *font_id == 0) { | |
554 LOG(ERROR) << "Bad response from RenderProcessHostMsg_LoadFont() for " << | 553 LOG(ERROR) << "Bad response from RenderProcessHostMsg_LoadFont() for " << |
555 src_font_descriptor.font_name; | 554 src_font_descriptor.font_name; |
556 *out = NULL; | 555 *out = NULL; |
557 *font_id = 0; | 556 *font_id = 0; |
558 return false; | 557 return false; |
559 } | 558 } |
560 | 559 |
561 // TODO(jeremy): Need to call back into WebKit to make sure that the font | 560 // TODO(jeremy): Need to call back into WebKit to make sure that the font |
562 // isn't already activated, based on the font id. If it's already | 561 // isn't already activated, based on the font id. If it's already |
563 // activated, don't reactivate it here - crbug.com/72727 . | 562 // activated, don't reactivate it here - crbug.com/72727 . |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 //------------------------------------------------------------------------------ | 1290 //------------------------------------------------------------------------------ |
1292 void RendererBlinkPlatformImpl::RequestPurgeMemory() { | 1291 void RendererBlinkPlatformImpl::RequestPurgeMemory() { |
1293 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but | 1292 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but |
1294 // ChildMemoryCoordinator isn't always available as it's only initialized | 1293 // ChildMemoryCoordinator isn't always available as it's only initialized |
1295 // when kMemoryCoordinatorV0 is enabled. | 1294 // when kMemoryCoordinatorV0 is enabled. |
1296 // Use ChildMemoryCoordinator when memory coordinator is always enabled. | 1295 // Use ChildMemoryCoordinator when memory coordinator is always enabled. |
1297 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); | 1296 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); |
1298 } | 1297 } |
1299 | 1298 |
1300 } // namespace content | 1299 } // namespace content |
OLD | NEW |