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

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: Fixes 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/safe_numerics.h"
9 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
10 #include "build/build_config.h" 11 #include "build/build_config.h"
11 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
12 #include "chrome/common/render_messages.h" 13 #include "chrome/common/render_messages.h"
13 #include "chrome/renderer/printing/print_web_view_helper.h" 14 #include "chrome/renderer/printing/print_web_view_helper.h"
14 #include "content/public/common/child_process_sandbox_support_linux.h" 15 #include "content/public/common/child_process_sandbox_support_linux.h"
15 #include "content/public/common/content_client.h" 16 #include "content/public/common/content_client.h"
16 #include "content/public/renderer/render_thread.h" 17 #include "content/public/renderer/render_thread.h"
17 #include "content/public/renderer/render_view.h" 18 #include "content/public/renderer/render_view.h"
18 #include "grit/webkit_resources.h" 19 #include "grit/webkit_resources.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 PrivateFontFile(PP_Instance instance, int fd) 55 PrivateFontFile(PP_Instance instance, int fd)
55 : Resource(ppapi::OBJECT_IS_IMPL, instance), 56 : Resource(ppapi::OBJECT_IS_IMPL, instance),
56 fd_(fd) { 57 fd_(fd) {
57 } 58 }
58 59
59 bool GetFontTable(uint32_t table, 60 bool GetFontTable(uint32_t table,
60 void* output, 61 void* output,
61 uint32_t* output_length) { 62 uint32_t* output_length) {
62 size_t temp_size = static_cast<size_t>(*output_length); 63 size_t temp_size = static_cast<size_t>(*output_length);
63 bool rv = content::GetFontTable( 64 bool rv = content::GetFontTable(
64 fd_, table, static_cast<uint8_t*>(output), &temp_size); 65 fd_, table, 0 /* offset */, static_cast<uint8_t*>(output), &temp_size);
65 *output_length = static_cast<uint32_t>(temp_size); 66 *output_length = base::checked_numeric_cast<uint32_t>(temp_size);
66 return rv; 67 return rv;
67 } 68 }
68 69
69 protected: 70 protected:
70 virtual ~PrivateFontFile() {} 71 virtual ~PrivateFontFile() {}
71 72
72 private: 73 private:
73 int fd_; 74 int fd_;
74 }; 75 };
75 #endif 76 #endif
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 WebKit::WebElement element = instance->container()->element(); 420 WebKit::WebElement element = instance->container()->element();
420 WebKit::WebView* view = element.document().frame()->view(); 421 WebKit::WebView* view = element.document().frame()->view();
421 content::RenderView* render_view = content::RenderView::FromWebView(view); 422 content::RenderView* render_view = content::RenderView::FromWebView(view);
422 423
423 using printing::PrintWebViewHelper; 424 using printing::PrintWebViewHelper;
424 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); 425 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view);
425 if (print_view_helper) 426 if (print_view_helper)
426 print_view_helper->PrintNode(element); 427 print_view_helper->PrintNode(element);
427 #endif 428 #endif
428 } 429 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698