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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 425653002: content: ResourceType cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 void WebContentsImpl::OnThemeColorChanged(SkColor theme_color) { 2605 void WebContentsImpl::OnThemeColorChanged(SkColor theme_color) {
2606 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2606 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2607 DidChangeThemeColor(theme_color)); 2607 DidChangeThemeColor(theme_color));
2608 } 2608 }
2609 2609
2610 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( 2610 void WebContentsImpl::OnDidLoadResourceFromMemoryCache(
2611 const GURL& url, 2611 const GURL& url,
2612 const std::string& security_info, 2612 const std::string& security_info,
2613 const std::string& http_method, 2613 const std::string& http_method,
2614 const std::string& mime_type, 2614 const std::string& mime_type,
2615 ResourceType::Type resource_type) { 2615 ResourceType resource_type) {
2616 base::StatsCounter cache("WebKit.CacheHit"); 2616 base::StatsCounter cache("WebKit.CacheHit");
2617 cache.Increment(); 2617 cache.Increment();
2618 2618
2619 // Send out a notification that we loaded a resource from our memory cache. 2619 // Send out a notification that we loaded a resource from our memory cache.
2620 int cert_id = 0; 2620 int cert_id = 0;
2621 net::CertStatus cert_status = 0; 2621 net::CertStatus cert_status = 0;
2622 int security_bits = -1; 2622 int security_bits = -1;
2623 int connection_status = 0; 2623 int connection_status = 0;
2624 SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids; 2624 SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids;
2625 DeserializeSecurityInfo(security_info, &cert_id, &cert_status, 2625 DeserializeSecurityInfo(security_info, &cert_id, &cert_status,
2626 &security_bits, &connection_status, 2626 &security_bits, &connection_status,
2627 &signed_certificate_timestamp_ids); 2627 &signed_certificate_timestamp_ids);
2628 // TODO(alcutter,eranm): Pass signed_certificate_timestamp_ids into details 2628 // TODO(alcutter,eranm): Pass signed_certificate_timestamp_ids into details
2629 LoadFromMemoryCacheDetails details( 2629 LoadFromMemoryCacheDetails details(
2630 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method, 2630 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method,
2631 mime_type, resource_type); 2631 mime_type, resource_type);
2632 2632
2633 controller_.ssl_manager()->DidLoadFromMemoryCache(details); 2633 controller_.ssl_manager()->DidLoadFromMemoryCache(details);
2634 2634
2635 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2635 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2636 DidLoadResourceFromMemoryCache(details)); 2636 DidLoadResourceFromMemoryCache(details));
2637 2637
2638 if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) { 2638 if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
2639 scoped_refptr<net::URLRequestContextGetter> request_context( 2639 scoped_refptr<net::URLRequestContextGetter> request_context(
2640 resource_type == ResourceType::MEDIA ? 2640 resource_type == RESOURCE_TYPE_MEDIA ?
2641 GetBrowserContext()->GetMediaRequestContextForRenderProcess( 2641 GetBrowserContext()->GetMediaRequestContextForRenderProcess(
2642 GetRenderProcessHost()->GetID()) : 2642 GetRenderProcessHost()->GetID()) :
2643 GetBrowserContext()->GetRequestContextForRenderProcess( 2643 GetBrowserContext()->GetRequestContextForRenderProcess(
2644 GetRenderProcessHost()->GetID())); 2644 GetRenderProcessHost()->GetID()));
2645 BrowserThread::PostTask( 2645 BrowserThread::PostTask(
2646 BrowserThread::IO, 2646 BrowserThread::IO,
2647 FROM_HERE, 2647 FROM_HERE,
2648 base::Bind(&NotifyCacheOnIO, request_context, url, http_method)); 2648 base::Bind(&NotifyCacheOnIO, request_context, url, http_method));
2649 } 2649 }
2650 } 2650 }
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after
4236 if (new_size != old_size) 4236 if (new_size != old_size)
4237 delegate_->UpdatePreferredSize(this, new_size); 4237 delegate_->UpdatePreferredSize(this, new_size);
4238 } 4238 }
4239 4239
4240 void WebContentsImpl::ResumeResponseDeferredAtStart() { 4240 void WebContentsImpl::ResumeResponseDeferredAtStart() {
4241 FrameTreeNode* node = frame_tree_.root(); 4241 FrameTreeNode* node = frame_tree_.root();
4242 node->render_manager()->ResumeResponseDeferredAtStart(); 4242 node->render_manager()->ResumeResponseDeferredAtStart();
4243 } 4243 }
4244 4244
4245 } // namespace content 4245 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/child/npapi/plugin_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698