Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix "unused variable" warnings.
Browse files Browse the repository at this point in the history
These were exposed by changing DISALLOW_COPY_AND_ASSIGN to use "= delete", and
must be fixed before that change can land.

See https://codereview.chromium.org/1981053002/ for the full CL.

BUG=447156
TEST=none

Review-Url: https://codereview.chromium.org/1995573004
Cr-Commit-Position: refs/heads/master@{#394814}
  • Loading branch information
pkasting authored and Commit bot committed May 19, 2016
1 parent 1d3480c commit 10cf76e
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ ResultExpr CrosArmGpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const {
} // namespace

CrosArmGpuProcessPolicy::CrosArmGpuProcessPolicy(bool allow_shmat)
: allow_shmat_(allow_shmat) {}
#if defined(__arm__) || defined(__aarch64__)
: allow_shmat_(allow_shmat)
#endif
{
}

CrosArmGpuProcessPolicy::~CrosArmGpuProcessPolicy() {}

Expand Down
2 changes: 2 additions & 0 deletions content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class CrosArmGpuProcessPolicy : public GpuProcessPolicy {
bool PreSandboxHook() override;

private:
#if defined(__arm__) || defined(__aarch64__)
const bool allow_shmat_; // Allow shmat(2).
#endif
DISALLOW_COPY_AND_ASSIGN(CrosArmGpuProcessPolicy);
};

Expand Down
8 changes: 2 additions & 6 deletions content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,9 @@ void RunSandboxSanityChecks(const std::string& process_type) {
std::unique_ptr<SandboxBPFBasePolicy> GetGpuProcessSandbox() {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
bool allow_sysv_shm = false;
if (command_line.HasSwitch(switches::kGpuSandboxAllowSysVShm)) {
DCHECK(IsArchitectureArm());
allow_sysv_shm = true;
}

if (IsChromeOS() && IsArchitectureArm()) {
bool allow_sysv_shm =
command_line.HasSwitch(switches::kGpuSandboxAllowSysVShm);
return std::unique_ptr<SandboxBPFBasePolicy>(
new CrosArmGpuProcessPolicy(allow_sysv_shm));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/threading/thread_checker.h"
#include "base/trace_event/trace_event.h"
#include "content/renderer/media/webrtc/track_observer.h"
#include "media/base/bind_to_current_loop.h"
Expand Down Expand Up @@ -45,9 +44,6 @@ class MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate
const scoped_refptr<media::VideoFrame>& video_frame);

private:
// Bound to the render thread.
base::ThreadChecker thread_checker_;

scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;

// |frame_callback_| is accessed on the IO thread.
Expand Down
9 changes: 0 additions & 9 deletions content/renderer/renderer_main_platform_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
#include "content/common/content_export.h"
#include "content/public/common/main_function_params.h"

#ifdef __OBJC__
@class NSBundle;
#else
class NSBundle;
#endif // __OBJC__

namespace content {

class CONTENT_EXPORT RendererMainPlatformDelegate {
Expand All @@ -40,9 +34,6 @@ class CONTENT_EXPORT RendererMainPlatformDelegate {
private:
#if defined(OS_WIN)
const MainFunctionParams& parameters_;
HMODULE sandbox_test_module_;
#elif defined(OS_MACOSX)
NSBundle* sandbox_tests_bundle_;
#endif

DISALLOW_COPY_AND_ASSIGN(RendererMainPlatformDelegate);
Expand Down
4 changes: 1 addition & 3 deletions content/renderer/renderer_main_platform_delegate_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ namespace content {

RendererMainPlatformDelegate::RendererMainPlatformDelegate(
const MainFunctionParams& parameters)
: parameters_(parameters),
sandbox_test_module_(NULL) {
}
: parameters_(parameters) {}

RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
}
Expand Down
7 changes: 5 additions & 2 deletions content/renderer/text_input_client_observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
namespace content {

TextInputClientObserver::TextInputClientObserver(RenderViewImpl* render_view)
: RenderViewObserver(render_view),
render_view_impl_(render_view) {
#if defined(ENABLE_PLUGINS)
: RenderViewObserver(render_view), render_view_impl_(render_view) {
#else
: RenderViewObserver(render_view) {
#endif
}

TextInputClientObserver::~TextInputClientObserver() {
Expand Down
2 changes: 2 additions & 0 deletions content/renderer/text_input_client_observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class TextInputClientObserver : public RenderViewObserver {
void OnFirstRectForCharacterRange(gfx::Range range);
void OnStringForRange(gfx::Range range);

#if defined(ENABLE_PLUGINS)
RenderViewImpl* const render_view_impl_;
#endif

DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver);
};
Expand Down
2 changes: 1 addition & 1 deletion content/shell/browser/shell_javascript_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ class ShellJavaScriptDialog {
void Cancel();

private:
ShellJavaScriptDialogManager* manager_;
JavaScriptDialogManager::DialogClosedCallback callback_;

#if defined(OS_MACOSX)
ShellJavaScriptDialogHelper* helper_; // owned
#elif defined(OS_WIN)
ShellJavaScriptDialogManager* manager_;
JavaScriptMessageType message_type_;
HWND dialog_win_;
base::string16 message_text_;
Expand Down
3 changes: 1 addition & 2 deletions content/shell/browser/shell_javascript_dialog_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ - (void)cancel {
const base::string16& message_text,
const base::string16& default_prompt_text,
const JavaScriptDialogManager::DialogClosedCallback& callback)
: manager_(manager),
callback_(callback) {
: callback_(callback) {
bool text_field = message_type == JAVASCRIPT_MESSAGE_TYPE_PROMPT;
bool one_button = message_type == JAVASCRIPT_MESSAGE_TYPE_ALERT;

Expand Down
4 changes: 2 additions & 2 deletions content/shell/browser/shell_javascript_dialog_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ ShellJavaScriptDialog::ShellJavaScriptDialog(
const base::string16& message_text,
const base::string16& default_prompt_text,
const JavaScriptDialogManager::DialogClosedCallback& callback)
: manager_(manager),
callback_(callback),
: callback_(callback),
manager_(manager),
message_type_(message_type),
message_text_(message_text),
default_prompt_text_(default_prompt_text) {
Expand Down
5 changes: 1 addition & 4 deletions content/test/mock_keyboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

namespace content {

MockKeyboard::MockKeyboard()
: keyboard_layout_(LAYOUT_NULL),
keyboard_modifiers_(INVALID) {
}
MockKeyboard::MockKeyboard() {}

MockKeyboard::~MockKeyboard() {
}
Expand Down
5 changes: 2 additions & 3 deletions content/test/mock_keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ class MockKeyboard {
std::wstring* output);

private:
Layout keyboard_layout_;
Modifiers keyboard_modifiers_;

#if defined(OS_WIN)
Layout keyboard_layout_ = LAYOUT_NULL;
Modifiers keyboard_modifiers_ = INVALID;
MockKeyboardDriverWin driver_;
#endif

Expand Down

0 comments on commit 10cf76e

Please sign in to comment.