diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-13 05:42:01 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-13 05:42:01 +0000 |
commit | 37a72af5fd711cbae056011afe9e42e7a89f9d48 (patch) | |
tree | 07805414cf7d41f261027a07fdc27fe52cf21a5f /content | |
parent | 3cb054e682096bb5596ca0403d7fed2548c83f2c (diff) | |
download | chromium_src-37a72af5fd711cbae056011afe9e42e7a89f9d48.zip chromium_src-37a72af5fd711cbae056011afe9e42e7a89f9d48.tar.gz chromium_src-37a72af5fd711cbae056011afe9e42e7a89f9d48.tar.bz2 |
Move load_from_memory_cache_details.* to content now that the SSL code has moved. Also move two easy dependencies behind the ContentBrowserClient.
BUG=76697
Review URL: http://codereview.chromium.org/7044130
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/DEPS | 6 | ||||
-rw-r--r-- | content/browser/content_browser_client.cc | 7 | ||||
-rw-r--r-- | content/browser/content_browser_client.h | 15 | ||||
-rw-r--r-- | content/browser/load_from_memory_cache_details.cc | 19 | ||||
-rw-r--r-- | content/browser/load_from_memory_cache_details.h | 35 | ||||
-rw-r--r-- | content/browser/renderer_host/async_resource_handler.cc | 10 | ||||
-rw-r--r-- | content/browser/renderer_host/render_message_filter.cc | 6 | ||||
-rw-r--r-- | content/browser/renderer_host/resource_dispatcher_host_delegate.cc | 8 | ||||
-rw-r--r-- | content/browser/renderer_host/resource_dispatcher_host_delegate.h | 9 | ||||
-rw-r--r-- | content/browser/renderer_host/sync_resource_handler.cc | 10 | ||||
-rw-r--r-- | content/browser/ssl/ssl_manager.cc | 2 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 2 | ||||
-rw-r--r-- | content/content_browser.gypi | 2 |
13 files changed, 111 insertions, 20 deletions
diff --git a/content/browser/DEPS b/content/browser/DEPS index a6aeb84..3cea607 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS @@ -23,12 +23,8 @@ include_rules = [ "+chrome/browser/renderer_host/download_throttling_resource_handler.h", "+chrome/browser/renderer_host/save_file_resource_handler.h", - "+chrome/browser/load_from_memory_cache_details.h", - "+chrome/browser/mach_broker_mac.h", - "+chrome/browser/net/load_timing_observer.h", - # http://crbug.com/76788 "+chrome/browser/profiles/profile.h", @@ -36,8 +32,6 @@ include_rules = [ "+chrome/browser/tab_contents/render_view_host_delegate_helper.h", - "+chrome/browser/ui/crypto_module_password_dialog.h", - "+chrome/common/chrome_constants.h", "+chrome/common/chrome_switches.h", "+chrome/common/chrome_paths.h", diff --git a/content/browser/content_browser_client.cc b/content/browser/content_browser_client.cc index 55be667..1ffb914 100644 --- a/content/browser/content_browser_client.cc +++ b/content/browser/content_browser_client.cc @@ -168,4 +168,11 @@ int ContentBrowserClient::GetCrashSignalFD(const std::string& process_type) { } #endif +#if defined(USE_NSS) +crypto::CryptoModuleBlockingPasswordDelegate* + ContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) { + return NULL; +} +#endif + } // namespace content diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h index 6149d15..51a4d30 100644 --- a/content/browser/content_browser_client.h +++ b/content/browser/content_browser_client.h @@ -28,6 +28,10 @@ class TabContents; class WorkerProcessHost; struct DesktopNotificationHostMsg_Show_Params; +namespace crypto { +class CryptoModuleBlockingPasswordDelegate; +} + namespace net { class CookieList; class CookieOptions; @@ -179,7 +183,8 @@ class ContentBrowserClient { int notification_id); // Returns true if the given page is allowed to open a window of the given - // type. This is called on the IO thread. + // type. + // This is called on the IO thread. virtual bool CanCreateWindow( const GURL& source_url, WindowContainerType container_type, @@ -199,6 +204,14 @@ class ContentBrowserClient { // Can return an optional fd for crash handling, otherwise returns -1. virtual int GetCrashSignalFD(const std::string& process_type); #endif + +#if defined(USE_NSS) + // Return a delegate to authenticate and unlock |module|. + // This is called on a worker thread. + virtual + crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( + const GURL& url); +#endif }; } // namespace content diff --git a/content/browser/load_from_memory_cache_details.cc b/content/browser/load_from_memory_cache_details.cc new file mode 100644 index 0000000..8574112 --- /dev/null +++ b/content/browser/load_from_memory_cache_details.cc @@ -0,0 +1,19 @@ +// Copyright (c) 2011 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. + +#include "content/browser/load_from_memory_cache_details.h" + +LoadFromMemoryCacheDetails::LoadFromMemoryCacheDetails( + const GURL& url, + int pid, + int cert_id, + int cert_status) + : url_(url), + pid_(pid), + cert_id_(cert_id), + cert_status_(cert_status) { +} + +LoadFromMemoryCacheDetails::~LoadFromMemoryCacheDetails() { +} diff --git a/content/browser/load_from_memory_cache_details.h b/content/browser/load_from_memory_cache_details.h new file mode 100644 index 0000000..0689792 --- /dev/null +++ b/content/browser/load_from_memory_cache_details.h @@ -0,0 +1,35 @@ +// Copyright (c) 2011 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_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ +#define CONTENT_BROWSER_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ +#pragma once + +#include "base/basictypes.h" +#include "googleurl/src/gurl.h" + +class LoadFromMemoryCacheDetails { + public: + LoadFromMemoryCacheDetails( + const GURL& url, + int pid, + int cert_id, + int cert_status); + ~LoadFromMemoryCacheDetails(); + + const GURL& url() const { return url_; } + int pid() const { return pid_; } + int ssl_cert_id() const { return cert_id_; } + int ssl_cert_status() const { return cert_status_; } + + private: + GURL url_; + int pid_; + int cert_id_; + int cert_status_; + + DISALLOW_COPY_AND_ASSIGN(LoadFromMemoryCacheDetails); +}; + +#endif // CONTENT_BROWSER_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ diff --git a/content/browser/renderer_host/async_resource_handler.cc b/content/browser/renderer_host/async_resource_handler.cc index 44866d1..21986e8 100644 --- a/content/browser/renderer_host/async_resource_handler.cc +++ b/content/browser/renderer_host/async_resource_handler.cc @@ -11,10 +11,10 @@ #include "base/logging.h" #include "base/shared_memory.h" #include "chrome/browser/debugger/devtools_netlog_observer.h" -#include "chrome/browser/net/load_timing_observer.h" #include "content/browser/host_zoom_map.h" #include "content/browser/renderer_host/global_request_id.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" +#include "content/browser/renderer_host/resource_dispatcher_host_delegate.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/renderer_host/resource_message_filter.h" #include "content/common/resource_response.h" @@ -105,7 +105,9 @@ bool AsyncResourceHandler::OnRequestRedirected(int request_id, *defer = true; net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(filter_->child_id(), request_id)); - LoadTimingObserver::PopulateTimingInfo(request, response); + if (rdh_->delegate()) + rdh_->delegate()->OnRequestRedirected(request, response); + DevToolsNetLogObserver::PopulateResponseInfo(request, response); return filter_->Send(new ResourceMsg_ReceivedRedirect( routing_id_, request_id, new_url, response->response_head)); @@ -121,7 +123,9 @@ bool AsyncResourceHandler::OnResponseStarted(int request_id, net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(filter_->child_id(), request_id)); - LoadTimingObserver::PopulateTimingInfo(request, response); + if (rdh_->delegate()) + rdh_->delegate()->OnResponseStarted(request, response); + DevToolsNetLogObserver::PopulateResponseInfo(request, response); ResourceDispatcherHostRequestInfo* info = rdh_->InfoForRequest(request); diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 0c03e9f..86a2af7 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -63,9 +63,6 @@ #if defined(OS_WIN) #include "content/common/child_process_host.h" #endif -#if defined(USE_NSS) -#include "chrome/browser/ui/crypto_module_password_dialog.h" -#endif using net::CookieStore; @@ -808,8 +805,7 @@ void RenderMessageFilter::OnKeygenOnWorkerThread( #if defined(USE_NSS) // Attach a password delegate so we can authenticate. keygen_handler.set_crypto_module_password_delegate( - browser::NewCryptoModuleBlockingDialogDelegate( - browser::kCryptoModulePasswordKeygen, url.host())); + content::GetContentClient()->browser()->GetCryptoPasswordDelegate(url)); #endif // defined(USE_NSS) ViewHostMsg_Keygen::WriteReplyParams( diff --git a/content/browser/renderer_host/resource_dispatcher_host_delegate.cc b/content/browser/renderer_host/resource_dispatcher_host_delegate.cc index c10f999..849b6a4 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_delegate.cc +++ b/content/browser/renderer_host/resource_dispatcher_host_delegate.cc @@ -66,3 +66,11 @@ bool ResourceDispatcherHostDelegate::ShouldForceDownloadResource( const GURL& url, const std::string& mime_type) { return false; } + +void ResourceDispatcherHostDelegate::OnResponseStarted( + net::URLRequest* request, ResourceResponse* response) { +} + +void ResourceDispatcherHostDelegate::OnRequestRedirected( + net::URLRequest* request, ResourceResponse* response) { +} diff --git a/content/browser/renderer_host/resource_dispatcher_host_delegate.h b/content/browser/renderer_host/resource_dispatcher_host_delegate.h index 0aee39a..bd25993 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_delegate.h +++ b/content/browser/renderer_host/resource_dispatcher_host_delegate.h @@ -14,6 +14,7 @@ class GURL; class ResourceDispatcherHostLoginDelegate; class ResourceHandler; struct ResourceHostMsg_Request; +struct ResourceResponse; namespace content { class ResourceContext; @@ -88,6 +89,14 @@ class ResourceDispatcherHostDelegate { virtual bool ShouldForceDownloadResource( const GURL& url, const std::string& mime_type); + // Informs the delegate that a response has started. + virtual void OnResponseStarted(net::URLRequest* request, + ResourceResponse* response); + + // Informs the delegate that a request has been redirected. + virtual void OnRequestRedirected(net::URLRequest* request, + ResourceResponse* response); + protected: ResourceDispatcherHostDelegate(); virtual ~ResourceDispatcherHostDelegate(); diff --git a/content/browser/renderer_host/sync_resource_handler.cc b/content/browser/renderer_host/sync_resource_handler.cc index 6d34094..6599e22 100644 --- a/content/browser/renderer_host/sync_resource_handler.cc +++ b/content/browser/renderer_host/sync_resource_handler.cc @@ -6,9 +6,9 @@ #include "base/logging.h" #include "chrome/browser/debugger/devtools_netlog_observer.h" -#include "chrome/browser/net/load_timing_observer.h" #include "content/browser/renderer_host/global_request_id.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" +#include "content/browser/renderer_host/resource_dispatcher_host_delegate.h" #include "content/browser/renderer_host/resource_message_filter.h" #include "content/common/resource_messages.h" #include "net/base/io_buffer.h" @@ -41,7 +41,9 @@ bool SyncResourceHandler::OnRequestRedirected(int request_id, bool* defer) { net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(filter_->child_id(), request_id)); - LoadTimingObserver::PopulateTimingInfo(request, response); + if (rdh_->delegate()) + rdh_->delegate()->OnRequestRedirected(request, response); + DevToolsNetLogObserver::PopulateResponseInfo(request, response); // TODO(darin): It would be much better if this could live in WebCore, but // doing so requires API changes at all levels. Similar code exists in @@ -58,7 +60,9 @@ bool SyncResourceHandler::OnResponseStarted(int request_id, ResourceResponse* response) { net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(filter_->child_id(), request_id)); - LoadTimingObserver::PopulateTimingInfo(request, response); + if (rdh_->delegate()) + rdh_->delegate()->OnResponseStarted(request, response); + DevToolsNetLogObserver::PopulateResponseInfo(request, response); // We don't care about copying the status here. diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc index 4efe034..0fd022c 100644 --- a/content/browser/ssl/ssl_manager.cc +++ b/content/browser/ssl/ssl_manager.cc @@ -5,8 +5,8 @@ #include "content/browser/ssl/ssl_manager.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/load_from_memory_cache_details.h" #include "content/browser/browser_thread.h" +#include "content/browser/load_from_memory_cache_details.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/renderer_host/resource_request_details.h" diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 95f8366..84167d1 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -14,12 +14,12 @@ #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/debugger/devtools_manager.h" -#include "chrome/browser/load_from_memory_cache_details.h" #include "chrome/browser/profiles/profile.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/content_browser_client.h" #include "content/browser/host_zoom_map.h" #include "content/browser/in_process_webkit/session_storage_namespace.h" +#include "content/browser/load_from_memory_cache_details.h" #include "content/browser/load_notification_details.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 05b6265f..5246fdd 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -171,6 +171,8 @@ 'browser/in_process_webkit/webkit_thread.cc', 'browser/in_process_webkit/webkit_thread.h', 'browser/javascript_dialogs.h', + 'browser/load_from_memory_cache_details.cc', + 'browser/load_from_memory_cache_details.h', 'browser/load_notification_details.h', 'browser/media_stream/media_stream_provider.cc', 'browser/media_stream/media_stream_provider.h', |