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

Side by Side Diff: content/renderer/npapi/webplugin_delegate_proxy.cc

Issue 897563002: Unify the three places that patch font loading for PDFium on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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/npapi/webplugin_delegate_proxy.h" 5 #include "content/renderer/npapi/webplugin_delegate_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 canvas->reset(skia::CreatePlatformCanvas( 633 canvas->reset(skia::CreatePlatformCanvas(
634 plugin_rect_.width(), plugin_rect_.height(), true, &((*memory)[0]), 634 plugin_rect_.width(), plugin_rect_.height(), true, &((*memory)[0]),
635 skia::CRASH_ON_FAILURE)); 635 skia::CRASH_ON_FAILURE));
636 return true; 636 return true;
637 } 637 }
638 #endif 638 #endif
639 639
640 bool WebPluginDelegateProxy::CreateSharedBitmap( 640 bool WebPluginDelegateProxy::CreateSharedBitmap(
641 scoped_ptr<SharedMemoryBitmap>* memory, 641 scoped_ptr<SharedMemoryBitmap>* memory,
642 scoped_ptr<skia::PlatformCanvas>* canvas) { 642 scoped_ptr<skia::PlatformCanvas>* canvas) {
643 *memory = ChildThread::current() 643 *memory = ChildThreadImpl::current()
644 ->shared_bitmap_manager() 644 ->shared_bitmap_manager()
645 ->AllocateSharedMemoryBitmap(plugin_rect_.size()); 645 ->AllocateSharedMemoryBitmap(plugin_rect_.size());
646 if (!memory->get()) 646 if (!memory->get())
647 return false; 647 return false;
648 DCHECK((*memory)->shared_memory()); 648 DCHECK((*memory)->shared_memory());
649 #if defined(OS_POSIX) 649 #if defined(OS_POSIX)
650 canvas->reset(skia::CreatePlatformCanvas( 650 canvas->reset(skia::CreatePlatformCanvas(
651 plugin_rect_.width(), plugin_rect_.height(), true, (*memory)->pixels(), 651 plugin_rect_.width(), plugin_rect_.height(), true, (*memory)->pixels(),
652 skia::RETURN_NULL_ON_FAILURE)); 652 skia::RETURN_NULL_ON_FAILURE));
653 #else 653 #else
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1236
1237 plugin_->URLRedirectResponse(allow, resource_id); 1237 plugin_->URLRedirectResponse(allow, resource_id);
1238 } 1238 }
1239 1239
1240 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, 1240 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url,
1241 bool* result) { 1241 bool* result) {
1242 *result = plugin_->CheckIfRunInsecureContent(url); 1242 *result = plugin_->CheckIfRunInsecureContent(url);
1243 } 1243 }
1244 1244
1245 } // namespace content 1245 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698