| Index: content/browser/renderer_host/routing_id_issuer.h
|
| diff --git a/content/browser/renderer_host/routing_id_issuer.h b/content/browser/renderer_host/routing_id_issuer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..36fc452e0433d48bc63f3e7220576a765103d4a6
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/routing_id_issuer.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2014 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_BROWSER_RENDERER_HOST_ROUTING_ID_ISSUER_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_ROUTING_ID_ISSUER_H_
|
| +
|
| +#include "base/atomic_sequence_num.h"
|
| +#include "base/macros.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/synchronization/lock.h"
|
| +#include "content/common/content_export.h"
|
| +#include "ipc/ipc_message.h"
|
| +
|
| +namespace content {
|
| +
|
| +// A debug facility for tightening the routing ID usage across multiple
|
| +// RenderProcessHost. The tracked ID is used by RenderProcessHost
|
| +// to verify if the given ID is correct.
|
| +class CONTENT_EXPORT RoutingIDIssuer {
|
| + public:
|
| + static scoped_ptr<RoutingIDIssuer> Create();
|
| + static scoped_ptr<RoutingIDIssuer> CreateWithMangler(int mangler);
|
| +
|
| + int IssueNext();
|
| + bool IsProbablyValid(int issued_id) const;
|
| +
|
| + private:
|
| + friend class RoutingIDManglingDisabler;
|
| +
|
| + static void DisableIDMangling();
|
| + static void EnableIDMangling();
|
| +
|
| + explicit RoutingIDIssuer(int mangler);
|
| +
|
| + base::AtomicSequenceNumber next_;
|
| + const int mangler_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(RoutingIDIssuer);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_ROUTING_ID_ISSUER_H_
|
|
|