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

Side by Side Diff: chrome/renderer/pepper/ppb_pdf_impl.cc

Issue 12433021: Modify content::GetFontTable so clients can control what is read. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modify param order. Created 7 years, 9 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 | Annotate | Revision Log
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 "chrome/renderer/pepper/ppb_pdf_impl.h" 5 #include "chrome/renderer/pepper/ppb_pdf_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 PrivateFontFile(PP_Instance instance, int fd) 54 PrivateFontFile(PP_Instance instance, int fd)
55 : Resource(ppapi::OBJECT_IS_IMPL, instance), 55 : Resource(ppapi::OBJECT_IS_IMPL, instance),
56 fd_(fd) { 56 fd_(fd) {
57 } 57 }
58 58
59 bool GetFontTable(uint32_t table, 59 bool GetFontTable(uint32_t table,
60 void* output, 60 void* output,
61 uint32_t* output_length) { 61 uint32_t* output_length) {
62 size_t temp_size = static_cast<size_t>(*output_length); 62 size_t temp_size = static_cast<size_t>(*output_length);
63 bool rv = content::GetFontTable( 63 bool rv = content::GetFontTable(
64 fd_, table, static_cast<uint8_t*>(output), &temp_size); 64 fd_, table, 0 /* offset */, static_cast<uint8_t*>(output), &temp_size);
65 *output_length = static_cast<uint32_t>(temp_size); 65 *output_length = static_cast<uint32_t>(temp_size);
palmer 2013/03/14 19:26:43 I'd use checked_numeric_cast (from base/) instead,
bbudge 2013/03/15 22:25:34 Done.
66 return rv; 66 return rv;
67 } 67 }
68 68
69 protected: 69 protected:
70 virtual ~PrivateFontFile() {} 70 virtual ~PrivateFontFile() {}
71 71
72 private: 72 private:
73 int fd_; 73 int fd_;
74 }; 74 };
75 #endif 75 #endif
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 WebKit::WebElement element = instance->container()->element(); 419 WebKit::WebElement element = instance->container()->element();
420 WebKit::WebView* view = element.document().frame()->view(); 420 WebKit::WebView* view = element.document().frame()->view();
421 content::RenderView* render_view = content::RenderView::FromWebView(view); 421 content::RenderView* render_view = content::RenderView::FromWebView(view);
422 422
423 using printing::PrintWebViewHelper; 423 using printing::PrintWebViewHelper;
424 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); 424 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view);
425 if (print_view_helper) 425 if (print_view_helper)
426 print_view_helper->PrintNode(element); 426 print_view_helper->PrintNode(element);
427 #endif 427 #endif
428 } 428 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698