diff options
author | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 01:02:00 +0000 |
---|---|---|
committer | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 01:02:00 +0000 |
commit | a02cf4c035866c71252bf06d097e5bb7d8a0892c (patch) | |
tree | 915d970c13350084b771983b1d6b8f1457883d8f /content | |
parent | 878b77e20f0e086730a3ba7e11d0b00b2c51dd01 (diff) | |
download | chromium_src-a02cf4c035866c71252bf06d097e5bb7d8a0892c.zip chromium_src-a02cf4c035866c71252bf06d097e5bb7d8a0892c.tar.gz chromium_src-a02cf4c035866c71252bf06d097e5bb7d8a0892c.tar.bz2 |
Moving LoadFromMemoryCacheDetails to content/public/browser and making it a struct.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10582007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/load_from_memory_cache_details.h | 47 | ||||
-rw-r--r-- | content/browser/ssl/ssl_manager.cc | 17 | ||||
-rw-r--r-- | content/browser/ssl/ssl_manager.h | 4 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 10 | ||||
-rw-r--r-- | content/content_browser.gypi | 4 | ||||
-rw-r--r-- | content/public/browser/load_from_memory_cache_details.cc (renamed from content/browser/load_from_memory_cache_details.cc) | 20 | ||||
-rw-r--r-- | content/public/browser/load_from_memory_cache_details.h | 38 |
7 files changed, 68 insertions, 72 deletions
diff --git a/content/browser/load_from_memory_cache_details.h b/content/browser/load_from_memory_cache_details.h deleted file mode 100644 index 1c69ca3..0000000 --- a/content/browser/load_from_memory_cache_details.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2012 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 <string> -#include "base/basictypes.h" -#include "googleurl/src/gurl.h" -#include "net/base/cert_status_flags.h" -#include "webkit/glue/resource_type.h" - -class LoadFromMemoryCacheDetails { - public: - LoadFromMemoryCacheDetails( - const GURL& url, - int pid, - int cert_id, - net::CertStatus cert_status, - const std::string& http_method, - const std::string& mime_type, - ResourceType::Type resource_type); - ~LoadFromMemoryCacheDetails(); - - const GURL& url() const { return url_; } - int pid() const { return pid_; } - int ssl_cert_id() const { return cert_id_; } - net::CertStatus ssl_cert_status() const { return cert_status_; } - const std::string& http_method() const { return http_method_; } - const std::string& mime_type() const { return mime_type_; } - ResourceType::Type resource_type() const { return resource_type_; } - - private: - GURL url_; - int pid_; - int cert_id_; - net::CertStatus cert_status_; - std::string http_method_; - std::string mime_type_; - ResourceType::Type resource_type_; - - DISALLOW_COPY_AND_ASSIGN(LoadFromMemoryCacheDetails); -}; - -#endif // CONTENT_BROWSER_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc index 753a5f4..45c4238 100644 --- a/content/browser/ssl/ssl_manager.cc +++ b/content/browser/ssl/ssl_manager.cc @@ -6,9 +6,7 @@ #include "base/bind.h" #include "base/utf_string_conversions.h" -#include "content/browser/load_from_memory_cache_details.h" #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" -#include "content/public/browser/resource_request_details.h" #include "content/browser/renderer_host/resource_request_info_impl.h" #include "content/browser/ssl/ssl_cert_error_handler.h" #include "content/browser/ssl/ssl_policy.h" @@ -17,9 +15,11 @@ #include "content/browser/web_contents/web_contents_impl.h" #include "content/common/ssl_status_serialization.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/load_from_memory_cache_details.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/resource_request_details.h" #include "content/public/common/ssl_status.h" #include "net/url_request/url_request.h" @@ -158,7 +158,7 @@ void SSLManager::Observe(int type, break; case content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE: DidLoadFromMemoryCache( - content::Details<LoadFromMemoryCacheDetails>(details).ptr()); + content::Details<content::LoadFromMemoryCacheDetails>(details).ptr()); break; case content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED: DidChangeSSLInternalState(); @@ -168,18 +168,19 @@ void SSLManager::Observe(int type, } } -void SSLManager::DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details) { +void SSLManager::DidLoadFromMemoryCache( + content::LoadFromMemoryCacheDetails* details) { // Simulate loading this resource through the usual path. // Note that we specify SUB_RESOURCE as the resource type as WebCore only // caches sub-resources. // This resource must have been loaded with no filtering because filtered // resouces aren't cachable. scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( - details->url(), + details->url, ResourceType::SUB_RESOURCE, - details->pid(), - details->ssl_cert_id(), - details->ssl_cert_status())); + details->pid, + details->cert_id, + details->cert_status)); // Simulate loading this resource through the usual path. policy()->OnRequestStarted(info.get()); diff --git a/content/browser/ssl/ssl_manager.h b/content/browser/ssl/ssl_manager.h index db5d5394..abd9b3a 100644 --- a/content/browser/ssl/ssl_manager.h +++ b/content/browser/ssl/ssl_manager.h @@ -21,12 +21,12 @@ #include "net/base/cert_status_flags.h" #include "net/base/net_errors.h" -class LoadFromMemoryCacheDetails; class NavigationControllerImpl; class SSLPolicy; namespace content { class NavigationEntryImpl; +struct LoadFromMemoryCacheDetails; struct ResourceRedirectDetails; struct ResourceRequestDetails; } @@ -99,7 +99,7 @@ class SSLManager : public content::NotificationObserver { // DidCommitProvisionalLoad uses the abstract NotificationDetails type since // the type we need is in NavigationController which would create a circular // header file dependency. - void DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details); + void DidLoadFromMemoryCache(content::LoadFromMemoryCacheDetails* details); void DidStartResourceResponse(content::ResourceRequestDetails* details); void DidReceiveResourceRedirect(content::ResourceRedirectDetails* details); void DidChangeSSLInternalState(); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 6b345d2..cb5de44 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -26,7 +26,6 @@ #include "content/browser/gpu/gpu_process_host.h" #include "content/browser/host_zoom_map_impl.h" #include "content/browser/intents/web_intents_dispatcher_impl.h" -#include "content/browser/load_from_memory_cache_details.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/render_widget_host_impl.h" @@ -48,6 +47,7 @@ #include "content/public/browser/download_url_parameters.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/javascript_dialogs.h" +#include "content/public/browser/load_from_memory_cache_details.h" #include "content/public/browser/load_notification_details.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/notification_details.h" @@ -1937,14 +1937,14 @@ void WebContentsImpl::OnDidLoadResourceFromMemoryCache( int connection_status = 0; content::DeserializeSecurityInfo(security_info, &cert_id, &cert_status, &security_bits, &connection_status); - LoadFromMemoryCacheDetails details(url, GetRenderProcessHost()->GetID(), - cert_id, cert_status, http_method, - mime_type, resource_type); + content::LoadFromMemoryCacheDetails details( + url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method, + mime_type, resource_type); content::NotificationService::current()->Notify( content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, content::Source<NavigationController>(&controller_), - content::Details<LoadFromMemoryCacheDetails>(&details)); + content::Details<content::LoadFromMemoryCacheDetails>(&details)); } void WebContentsImpl::OnDidDisplayInsecureContent() { diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 69149f8..2c50670 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -91,6 +91,8 @@ 'public/browser/invalidate_type.h', 'public/browser/javascript_dialogs.h', 'public/browser/keyboard_listener.h', + 'public/browser/load_from_memory_cache_details.cc', + 'public/browser/load_from_memory_cache_details.h', 'public/browser/load_notification_details.h', 'public/browser/native_web_keyboard_event.h', 'public/browser/navigation_controller.h', @@ -424,8 +426,6 @@ 'browser/intents/internal_web_intents_dispatcher.h', 'browser/intents/web_intents_dispatcher_impl.cc', 'browser/intents/web_intents_dispatcher_impl.h', - 'browser/load_from_memory_cache_details.cc', - 'browser/load_from_memory_cache_details.h', 'browser/mach_broker_mac.cc', 'browser/mach_broker_mac.h', 'browser/mime_registry_message_filter.cc', diff --git a/content/browser/load_from_memory_cache_details.cc b/content/public/browser/load_from_memory_cache_details.cc index e6bbb9a..a6ce4e5 100644 --- a/content/browser/load_from_memory_cache_details.cc +++ b/content/public/browser/load_from_memory_cache_details.cc @@ -2,7 +2,9 @@ // 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" +#include "content/public/browser/load_from_memory_cache_details.h" + +namespace content { LoadFromMemoryCacheDetails::LoadFromMemoryCacheDetails( const GURL& url, @@ -12,14 +14,16 @@ LoadFromMemoryCacheDetails::LoadFromMemoryCacheDetails( const std::string& http_method, const std::string& mime_type, ResourceType::Type resource_type) - : url_(url), - pid_(pid), - cert_id_(cert_id), - cert_status_(cert_status), - http_method_(http_method), - mime_type_(mime_type), - resource_type_(resource_type) { + : url(url), + pid(pid), + cert_id(cert_id), + cert_status(cert_status), + http_method(http_method), + mime_type(mime_type), + resource_type(resource_type) { } LoadFromMemoryCacheDetails::~LoadFromMemoryCacheDetails() { } + +} // namespace content diff --git a/content/public/browser/load_from_memory_cache_details.h b/content/public/browser/load_from_memory_cache_details.h new file mode 100644 index 0000000..b022b0c --- /dev/null +++ b/content/public/browser/load_from_memory_cache_details.h @@ -0,0 +1,38 @@ +// Copyright (c) 2012 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_PUBLIC_BROWSER_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ +#define CONTENT_PUBLIC_BROWSER_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ +#pragma once + +#include <string> +#include "base/basictypes.h" +#include "googleurl/src/gurl.h" +#include "net/base/cert_status_flags.h" +#include "webkit/glue/resource_type.h" + +namespace content { + +struct LoadFromMemoryCacheDetails { + LoadFromMemoryCacheDetails(const GURL& url, + int pid, + int cert_id, + net::CertStatus cert_status, + const std::string& http_method, + const std::string& mime_type, + ResourceType::Type resource_type); + ~LoadFromMemoryCacheDetails(); + + GURL url; + int pid; + int cert_id; + net::CertStatus cert_status; + std::string http_method; + std::string mime_type; + ResourceType::Type resource_type; +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_BROWSER_LOAD_FROM_MEMORY_CACHE_DETAILS_H_ |