Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/pepper_audio_output_host.cc ('k') | gpu/ipc/client/gpu_channel_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 uint32_t font_data_size; 539 uint32_t font_data_size;
540 FontDescriptor src_font_descriptor(src_font); 540 FontDescriptor src_font_descriptor(src_font);
541 base::SharedMemoryHandle font_data; 541 base::SharedMemoryHandle font_data;
542 if (!RenderThread::Get()->Send(new RenderProcessHostMsg_LoadFont( 542 if (!RenderThread::Get()->Send(new RenderProcessHostMsg_LoadFont(
543 src_font_descriptor, &font_data_size, &font_data, font_id))) { 543 src_font_descriptor, &font_data_size, &font_data, font_id))) {
544 *out = NULL; 544 *out = NULL;
545 *font_id = 0; 545 *font_id = 0;
546 return false; 546 return false;
547 } 547 }
548 548
549 if (font_data_size == 0 || font_data == base::SharedMemory::NULLHandle() || 549 if (font_data_size == 0 || !font_data.IsValid() || *font_id == 0) {
550 *font_id == 0) {
551 LOG(ERROR) << "Bad response from RenderProcessHostMsg_LoadFont() for " << 550 LOG(ERROR) << "Bad response from RenderProcessHostMsg_LoadFont() for " <<
552 src_font_descriptor.font_name; 551 src_font_descriptor.font_name;
553 *out = NULL; 552 *out = NULL;
554 *font_id = 0; 553 *font_id = 0;
555 return false; 554 return false;
556 } 555 }
557 556
558 // TODO(jeremy): Need to call back into WebKit to make sure that the font 557 // TODO(jeremy): Need to call back into WebKit to make sure that the font
559 // isn't already activated, based on the font id. If it's already 558 // isn't already activated, based on the font id. If it's already
560 // activated, don't reactivate it here - crbug.com/72727 . 559 // activated, don't reactivate it here - crbug.com/72727 .
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 //------------------------------------------------------------------------------ 1273 //------------------------------------------------------------------------------
1275 void RendererBlinkPlatformImpl::RequestPurgeMemory() { 1274 void RendererBlinkPlatformImpl::RequestPurgeMemory() {
1276 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1275 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1277 // ChildMemoryCoordinator isn't always available as it's only initialized 1276 // ChildMemoryCoordinator isn't always available as it's only initialized
1278 // when kMemoryCoordinatorV0 is enabled. 1277 // when kMemoryCoordinatorV0 is enabled.
1279 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1278 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1280 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1279 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1281 } 1280 }
1282 1281
1283 } // namespace content 1282 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_audio_output_host.cc ('k') | gpu/ipc/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698