Commit b5cdb387 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

ppapi: Fix nits in some PDF API code.

- Mark parameters const for SetAccessibilityViewportInfo() and
  SetAccessibilityDocInfo().
- Fix lint errors.

Change-Id: I2d54ac4e4b04acb20b7b86767534b30bfba8541e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1794502
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697217}
parent 704275aa
......@@ -184,13 +184,13 @@ struct PPB_PDF {
// support.
void (*SetAccessibilityViewportInfo)(
PP_Instance instance,
struct PP_PrivateAccessibilityViewportInfo* viewport_info);
const struct PP_PrivateAccessibilityViewportInfo* viewport_info);
// Sends information about the PDF document to the renderer for accessibility
// support.
void (*SetAccessibilityDocInfo)(
PP_Instance instance,
struct PP_PrivateAccessibilityDocInfo* doc_info);
const struct PP_PrivateAccessibilityDocInfo* doc_info);
// Sends information about one page in a PDF document to the renderer for
// accessibility support.
......
......@@ -203,7 +203,7 @@ void PDF::GetV8ExternalSnapshotData(const InstanceHandle& instance,
// static
void PDF::SetAccessibilityViewportInfo(
const InstanceHandle& instance,
PP_PrivateAccessibilityViewportInfo* viewport_info) {
const PP_PrivateAccessibilityViewportInfo* viewport_info) {
if (has_interface<PPB_PDF>()) {
get_interface<PPB_PDF>()->SetAccessibilityViewportInfo(
instance.pp_instance(), viewport_info);
......@@ -211,8 +211,9 @@ void PDF::SetAccessibilityViewportInfo(
}
// static
void PDF::SetAccessibilityDocInfo(const InstanceHandle& instance,
PP_PrivateAccessibilityDocInfo* doc_info) {
void PDF::SetAccessibilityDocInfo(
const InstanceHandle& instance,
const PP_PrivateAccessibilityDocInfo* doc_info) {
if (has_interface<PPB_PDF>()) {
get_interface<PPB_PDF>()->SetAccessibilityDocInfo(instance.pp_instance(),
doc_info);
......
......@@ -86,10 +86,10 @@ class PDF {
int* snapshot_size_out);
static void SetAccessibilityViewportInfo(
const InstanceHandle& instance,
PP_PrivateAccessibilityViewportInfo* viewport_info);
const PP_PrivateAccessibilityViewportInfo* viewport_info);
static void SetAccessibilityDocInfo(
const InstanceHandle& instance,
PP_PrivateAccessibilityDocInfo* doc_info);
const PP_PrivateAccessibilityDocInfo* doc_info);
static void SetAccessibilityPageInfo(
const InstanceHandle& instance,
const PP_PrivateAccessibilityPageInfo* page_info,
......
......@@ -9,6 +9,10 @@
#include <stdlib.h>
#include <string.h>
#include <limits>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/metrics/histogram.h"
......@@ -201,12 +205,12 @@ void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out,
}
void PDFResource::SetAccessibilityDocInfo(
PP_PrivateAccessibilityDocInfo* doc_info) {
const PP_PrivateAccessibilityDocInfo* doc_info) {
Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityDocInfo(*doc_info));
}
void PDFResource::SetAccessibilityViewportInfo(
PP_PrivateAccessibilityViewportInfo* viewport_info) {
const PP_PrivateAccessibilityViewportInfo* viewport_info) {
Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityViewportInfo(*viewport_info));
}
......
......@@ -5,6 +5,8 @@
#ifndef PPAPI_PROXY_PDF_RESOURCE_H_
#define PPAPI_PROXY_PDF_RESOURCE_H_
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "ppapi/c/pp_instance.h"
......@@ -57,9 +59,9 @@ class PPAPI_PROXY_EXPORT PDFResource
const char** snapshot_data_out,
int* snapshot_size_out) override;
void SetAccessibilityViewportInfo(
PP_PrivateAccessibilityViewportInfo* viewport_info) override;
const PP_PrivateAccessibilityViewportInfo* viewport_info) override;
void SetAccessibilityDocInfo(
PP_PrivateAccessibilityDocInfo* doc_info) override;
const PP_PrivateAccessibilityDocInfo* doc_info) override;
void SetAccessibilityPageInfo(
const PP_PrivateAccessibilityPageInfo* page_info,
const PP_PrivateAccessibilityTextRunInfo text_runs[],
......
......@@ -37,9 +37,9 @@ class PPB_PDF_API {
const char** snapshot_data_out,
int* snapshot_size_out) = 0;
virtual void SetAccessibilityViewportInfo(
PP_PrivateAccessibilityViewportInfo* viewport_info) = 0;
const PP_PrivateAccessibilityViewportInfo* viewport_info) = 0;
virtual void SetAccessibilityDocInfo(
PP_PrivateAccessibilityDocInfo* doc_info) = 0;
const PP_PrivateAccessibilityDocInfo* doc_info) = 0;
virtual void SetAccessibilityPageInfo(
const PP_PrivateAccessibilityPageInfo* page_info,
const PP_PrivateAccessibilityTextRunInfo text_runs[],
......
......@@ -155,7 +155,7 @@ void GetV8ExternalSnapshotData(PP_Instance instance,
void SetAccessibilityViewportInfo(
PP_Instance instance,
PP_PrivateAccessibilityViewportInfo* viewport_info) {
const PP_PrivateAccessibilityViewportInfo* viewport_info) {
EnterInstanceAPI<PPB_PDF_API> enter(instance);
if (enter.failed())
return;
......@@ -163,7 +163,7 @@ void SetAccessibilityViewportInfo(
}
void SetAccessibilityDocInfo(PP_Instance instance,
PP_PrivateAccessibilityDocInfo* doc_info) {
const PP_PrivateAccessibilityDocInfo* doc_info) {
EnterInstanceAPI<PPB_PDF_API> enter(instance);
if (enter.failed())
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment