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

Unified Diff: content/browser/renderer_host/render_widget_helper.cc

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.cc
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc
index 1f88835cd275d8fe60cc96cbc4735ac4ed5025ee..a06bb019dcebff9b9d0f107ec4994fdc903b66bc 100644
--- a/content/browser/renderer_host/render_widget_helper.cc
+++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -10,12 +10,13 @@
#include "base/posix/eintr_wrapper.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
+#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/browser/dom_storage/session_storage_namespace_impl.h"
+#include "content/browser/renderer_host/routing_id_issuer.h"
#include "content/common/view_messages.h"
namespace content {
@@ -37,6 +38,7 @@ void AddWidgetHelper(int render_process_id,
RenderWidgetHelper::RenderWidgetHelper()
: render_process_id_(-1),
+ routing_id_issuer_(RoutingIDIssuer::Create()),
resource_dispatcher_host_(NULL) {
}
@@ -67,7 +69,11 @@ void RenderWidgetHelper::Init(
}
int RenderWidgetHelper::GetNextRoutingID() {
- return next_routing_id_.GetNext() + 1;
+ return routing_id_issuer_->IssueNext();
+}
+
+int RenderWidgetHelper::IsRoutingIDProbablyValid(int routing_id) const {
+ return routing_id_issuer_->IsProbablyValid(routing_id);
}
// static

Powered by Google App Engine
This is Rietveld 408576698