
When this CL is approved I will rebase it on top of tree and mass migrate all callers in a new patch set (TBR'ed change). TBR=robliao@chromium.org (for mass migration of existing callers) Bug: 867421 Change-Id: I41092bbc4824964ee047e0bf53e972c8f6e896a4 Reviewed-on: https://chromium-review.googlesource.com/1161116 Commit-Queue: Gabriel Charette <gab@chromium.org> Reviewed-by: Gabriel Charette <gab@chromium.org> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org> Cr-Commit-Position: refs/heads/master@{#580845}
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef CONTENT_RENDERER_RENDER_PROCESS_H_
|
|
#define CONTENT_RENDERER_RENDER_PROCESS_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "base/macros.h"
|
|
#include "base/task/task_scheduler/task_scheduler.h"
|
|
#include "content/child/child_process.h"
|
|
|
|
namespace content {
|
|
|
|
// A abstract interface representing the renderer end of the browser<->renderer
|
|
// connection. The opposite end is the RenderProcessHost. This is a singleton
|
|
// object for each renderer.
|
|
//
|
|
// RenderProcessImpl implements this interface for the regular browser.
|
|
// MockRenderProcess implements this interface for certain tests, especially
|
|
// ones derived from RenderViewTest.
|
|
class RenderProcess : public ChildProcess {
|
|
public:
|
|
RenderProcess() = default;
|
|
RenderProcess(const std::string& task_scheduler_name,
|
|
std::unique_ptr<base::TaskScheduler::InitParams>
|
|
task_scheduler_init_params);
|
|
~RenderProcess() override {}
|
|
|
|
// Keep track of the cumulative set of enabled bindings for this process,
|
|
// across any view.
|
|
virtual void AddBindings(int bindings) = 0;
|
|
|
|
// The cumulative set of enabled bindings for this process.
|
|
virtual int GetEnabledBindings() const = 0;
|
|
|
|
// Returns a pointer to the RenderProcess singleton instance. Assuming that
|
|
// we're actually a renderer or a renderer test, this static cast will
|
|
// be correct.
|
|
static RenderProcess* current() {
|
|
return static_cast<RenderProcess*>(ChildProcess::current());
|
|
}
|
|
|
|
private:
|
|
DISALLOW_COPY_AND_ASSIGN(RenderProcess);
|
|
};
|
|
|
|
} // namespace content
|
|
|
|
#endif // CONTENT_RENDERER_RENDER_PROCESS_H_
|