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

Side by Side Diff: content/browser/renderer_host/routing_id_issuer.h

Issue 643733002: Add RoutingIDIssuer to ensure the correctness of ID to be routed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 6 years, 2 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_ROUTING_ID_ISSUER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_ROUTING_ID_ISSUER_H_
7
8 #include "base/atomic_sequence_num.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/synchronization/lock.h"
12 #include "content/common/content_export.h"
13 #include "ipc/ipc_message.h"
14
15 namespace content {
16
17 // A debug facility for tightening the routing ID usage across multiple
18 // RenderProcessHost. The tracked ID is used by RenderProcessHost
19 // to verify if the given ID is correct.
20 class CONTENT_EXPORT RoutingIDIssuer {
21 public:
22 static scoped_ptr<RoutingIDIssuer> Create();
23 static scoped_ptr<RoutingIDIssuer> CreateWithMangler(int mangler);
24
25 int IssueNext();
26 bool IsProbablyValid(int issued_id) const;
27
28 private:
29 friend class RoutingIDManglingDisabler;
30
31 static void DisableIDMangling();
32 static void EnableIDMangling();
33
34 explicit RoutingIDIssuer(int mangler);
35
36 base::AtomicSequenceNumber next_;
37 const int mangler_;
38
39 DISALLOW_COPY_AND_ASSIGN(RoutingIDIssuer);
40 };
41
42 } // namespace content
43
44 #endif // CONTENT_BROWSER_RENDERER_HOST_ROUTING_ID_ISSUER_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_helper.cc ('k') | content/browser/renderer_host/routing_id_issuer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698