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

Unified Diff: content/browser/renderer_host/render_widget_helper.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: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_helper.h
diff --git a/content/browser/renderer_host/render_widget_helper.h b/content/browser/renderer_host/render_widget_helper.h
index 98b3ca6cdb8aab356835d9026984bba7ed5c6667..acf25444dca2139115bee64b33d20fa30d24c7ee 100644
--- a/content/browser/renderer_host/render_widget_helper.h
+++ b/content/browser/renderer_host/render_widget_helper.h
@@ -7,9 +7,9 @@
#include <map>
-#include "base/atomic_sequence_num.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/process/process.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -33,6 +33,7 @@ struct ViewMsg_SwapOut_Params;
namespace content {
class GpuProcessHost;
class ResourceDispatcherHostImpl;
+class RoutingIDIssuer;
class SessionStorageNamespace;
// Instantiated per RenderProcessHost to provide various optimizations on
@@ -80,6 +81,9 @@ class RenderWidgetHelper
// Gets the next available routing id. This is thread safe.
int GetNextRoutingID();
+ // Probablistically verify if he ID is issued by this helper.
nasko 2014/10/13 21:04:00 nit: s/if he/if the/
Hajime Morrita 2014/10/13 22:23:54 Done.
+ // Thread safe.
+ int IsRoutingIDProbablyValid(int routing_id) const;
nasko 2014/10/13 21:04:00 Why return int, when the expected output value is
Hajime Morrita 2014/10/13 22:23:54 Oops. should've returned a bool.
// IO THREAD ONLY -----------------------------------------------------------
@@ -175,8 +179,7 @@ class RenderWidgetHelper
int render_process_id_;
- // The next routing id to use.
- base::AtomicSequenceNumber next_routing_id_;
+ scoped_ptr<RoutingIDIssuer> routing_id_issuer_;
ResourceDispatcherHostImpl* resource_dispatcher_host_;

Powered by Google App Engine
This is Rietveld 408576698