summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 17:27:45 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 17:27:45 +0000
commit76543b9c43515c8c68413b25d682b7c15a151905 (patch)
tree3fa26b07a2de8102561d5ded5828797fa9a375ab /chrome/browser/ssl
parentf341f8f58ceeae4efe38daf3c26ad4581f98fd2d (diff)
downloadchromium_src-76543b9c43515c8c68413b25d682b7c15a151905.zip
chromium_src-76543b9c43515c8c68413b25d682b7c15a151905.tar.gz
chromium_src-76543b9c43515c8c68413b25d682b7c15a151905.tar.bz2
Replace the RenderProcessHost.PID function that returns the OS-generated
process ID with an internally-generated id() function. This allows us the guarantee that the IDs are unique over the entire run of the application. This also cleans up some code associated with managing the PID. The main potentially interesting change is now the PID is set uniquely for every creation of RenderProcessHost. It used to be set cleared if the process went away, and re-set if the process was re-created. The ID generation is in ChildProcesInfo so it is also unique between workers and plugins. I had to change some significant things in resource_dispatcher_host_unittest to take into account this new generation of IDs. BUG=17828 TEST=none Review URL: http://codereview.chromium.org/160203 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl')
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc2
-rw-r--r--chrome/browser/ssl/ssl_error_handler.cc2
-rw-r--r--chrome/browser/ssl/ssl_manager.cc7
-rw-r--r--chrome/browser/ssl/ssl_policy.cc11
-rw-r--r--chrome/browser/ssl/ssl_policy_backend.cc4
-rw-r--r--chrome/browser/ssl/ssl_request_info.h8
6 files changed, 18 insertions, 16 deletions
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index 5d3e821..a25fda3 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -91,7 +91,7 @@ std::string SSLBlockingPage::GetHTMLContents() {
void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) {
const net::SSLInfo& ssl_info = handler_->ssl_info();
int cert_id = CertStore::GetSharedInstance()->StoreCert(
- ssl_info.cert, tab()->render_view_host()->process()->pid());
+ ssl_info.cert, tab()->render_view_host()->process()->id());
entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN);
entry->ssl().set_cert_id(cert_id);
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc
index b7f3fd2..ed04c6fb 100644
--- a/chrome/browser/ssl/ssl_error_handler.cc
+++ b/chrome/browser/ssl/ssl_error_handler.cc
@@ -32,7 +32,7 @@ SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh,
ResourceDispatcherHost::ExtraRequestInfo* info =
ResourceDispatcherHost::ExtraInfoForRequest(request);
- request_id_.process_id = info->process_id;
+ request_id_.child_id = info->child_id;
request_id_.request_id = info->request_id;
if (!ResourceDispatcherHost::RenderViewForRequest(request,
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 573597c..63e590d 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -7,6 +7,7 @@
#include "app/l10n_util.h"
#include "base/message_loop.h"
#include "chrome/browser/load_from_memory_cache_details.h"
+#include "chrome/browser/net/url_request_tracking.h"
#include "chrome/browser/renderer_host/resource_request_details.h"
#include "chrome/browser/ssl/ssl_cert_error_handler.h"
#include "chrome/browser/ssl/ssl_mixed_content_handler.h"
@@ -109,7 +110,7 @@ bool SSLManager::ShouldStartRequest(ResourceDispatcherHost* rdh,
info->resource_type,
info->frame_origin,
info->main_frame_origin,
- info->process_id,
+ info->child_id,
ui_loop),
&SSLMixedContentHandler::Dispatch));
return false;
@@ -241,7 +242,7 @@ void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) {
details->frame_origin(),
details->main_frame_origin(),
details->filter_policy(),
- details->origin_pid(),
+ details->origin_child_id(),
details->ssl_cert_id(),
details->ssl_cert_status());
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc
index cbef647..dd536ef 100644
--- a/chrome/browser/ssl/ssl_policy.cc
+++ b/chrome/browser/ssl/ssl_policy.cc
@@ -175,7 +175,7 @@ void SSLPolicy::UpdateEntry(NavigationEntry* entry) {
// possibly have mixed content. See bug http://crbug.com/12423.
if (site_instance &&
backend_->DidMarkHostAsBroken(entry->url().host(),
- site_instance->GetProcess()->pid()))
+ site_instance->GetProcess()->id()))
entry->ssl().set_has_mixed_content();
}
@@ -299,7 +299,8 @@ void SSLPolicy::ShowErrorPage(SSLCertErrorHandler* handler) {
TabContents* tab = handler->GetTabContents();
int cert_id = CertStore::GetSharedInstance()->StoreCert(
- handler->ssl_info().cert, tab->render_view_host()->process()->pid());
+ handler->ssl_info().cert,
+ tab->render_view_host()->process()->id());
std::string security_info =
SSLManager::SerializeSecurityInfo(cert_id,
handler->ssl_info().cert_status,
@@ -350,18 +351,18 @@ void SSLPolicy::UpdateStateForMixedContent(SSLRequestInfo* info) {
if (info->resource_type() != ResourceType::MAIN_FRAME ||
info->resource_type() != ResourceType::SUB_FRAME) {
// The frame's origin now contains mixed content and therefore is broken.
- MarkOriginAsBroken(info->frame_origin(), info->pid());
+ MarkOriginAsBroken(info->frame_origin(), info->child_id());
}
if (info->resource_type() != ResourceType::MAIN_FRAME) {
// The main frame now contains a frame with mixed content. Therefore, we
// mark the main frame's origin as broken too.
- MarkOriginAsBroken(info->main_frame_origin(), info->pid());
+ MarkOriginAsBroken(info->main_frame_origin(), info->child_id());
}
}
void SSLPolicy::UpdateStateForUnsafeContent(SSLRequestInfo* info) {
// This request as a broken cert, which means its host is broken.
- backend_->MarkHostAsBroken(info->url().host(), info->pid());
+ backend_->MarkHostAsBroken(info->url().host(), info->child_id());
UpdateStateForMixedContent(info);
}
diff --git a/chrome/browser/ssl/ssl_policy_backend.cc b/chrome/browser/ssl/ssl_policy_backend.cc
index e249252..592ccc0 100644
--- a/chrome/browser/ssl/ssl_policy_backend.cc
+++ b/chrome/browser/ssl/ssl_policy_backend.cc
@@ -127,8 +127,8 @@ void SSLPolicyBackend::AddMessageToConsole(
string16(), message, level);
}
-void SSLPolicyBackend::MarkHostAsBroken(const std::string& host, int pid) {
- ssl_host_state_->MarkHostAsBroken(host, pid);
+void SSLPolicyBackend::MarkHostAsBroken(const std::string& host, int id) {
+ ssl_host_state_->MarkHostAsBroken(host, id);
DispatchSSLInternalStateChanged();
}
diff --git a/chrome/browser/ssl/ssl_request_info.h b/chrome/browser/ssl/ssl_request_info.h
index fc8e417..3daf91f 100644
--- a/chrome/browser/ssl/ssl_request_info.h
+++ b/chrome/browser/ssl/ssl_request_info.h
@@ -21,7 +21,7 @@ class SSLRequestInfo : public base::RefCounted<SSLRequestInfo> {
const std::string& frame_origin,
const std::string& main_frame_origin,
FilterPolicy::Type filter_policy,
- int pid,
+ int child_id,
int ssl_cert_id,
int ssl_cert_status)
: url_(url),
@@ -29,7 +29,7 @@ class SSLRequestInfo : public base::RefCounted<SSLRequestInfo> {
frame_origin_(frame_origin),
main_frame_origin_(main_frame_origin),
filter_policy_(filter_policy),
- pid_(pid),
+ child_id_(child_id),
ssl_cert_id_(ssl_cert_id),
ssl_cert_status_(ssl_cert_status) {
}
@@ -39,7 +39,7 @@ class SSLRequestInfo : public base::RefCounted<SSLRequestInfo> {
const std::string& frame_origin() const { return frame_origin_; }
const std::string& main_frame_origin() const { return main_frame_origin_; }
FilterPolicy::Type filter_policy() const { return filter_policy_; }
- int pid() const { return pid_; }
+ int child_id() const { return child_id_; }
int ssl_cert_id() const { return ssl_cert_id_; }
int ssl_cert_status() const { return ssl_cert_status_; }
@@ -49,7 +49,7 @@ class SSLRequestInfo : public base::RefCounted<SSLRequestInfo> {
std::string frame_origin_;
std::string main_frame_origin_;
FilterPolicy::Type filter_policy_;
- int pid_;
+ int child_id_;
int ssl_cert_id_;
int ssl_cert_status_;