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

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 6672065: Support touch icon in FaviconHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error for clank mac and unit test memory leak Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/background_contents_service.h" 10 #include "chrome/browser/background_contents_service.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 441 }
442 } 442 }
443 443
444 void PrerenderContents::OnDidRedirectProvisionalLoad(int32 page_id, 444 void PrerenderContents::OnDidRedirectProvisionalLoad(int32 page_id,
445 const GURL& source_url, 445 const GURL& source_url,
446 const GURL& target_url) { 446 const GURL& target_url) {
447 if (!AddAliasURL(target_url)) 447 if (!AddAliasURL(target_url))
448 Destroy(FINAL_STATUS_HTTPS); 448 Destroy(FINAL_STATUS_HTTPS);
449 } 449 }
450 450
451 void PrerenderContents::OnUpdateFaviconURL(int32 page_id, 451 void PrerenderContents::OnUpdateFaviconURL(
452 const GURL& icon_url) { 452 int32 page_id,
453 icon_url_ = icon_url; 453 const std::vector<FaviconURL>& urls) {
454 LOG(INFO) << "PrerenderContents::OnUpdateFaviconURL" << icon_url_;
455 for (std::vector<FaviconURL>::const_iterator i = urls.begin();
456 i != urls.end(); ++i) {
457 if (i->icon_type == FAVICON) {
458 icon_url_ = i->icon_url;
459 LOG(INFO) << icon_url_;
460 return;
461 }
462 }
454 } 463 }
455 464
456 void PrerenderContents::OnMaybeCancelPrerender( 465 void PrerenderContents::OnMaybeCancelPrerender(
457 PrerenderCancellationReason reason) { 466 PrerenderCancellationReason reason) {
458 switch (reason) { 467 switch (reason) {
459 case PRERENDER_CANCELLATION_REASON_HTML5_MEDIA: 468 case PRERENDER_CANCELLATION_REASON_HTML5_MEDIA:
460 Destroy(FINAL_STATUS_HTML5_MEDIA); 469 Destroy(FINAL_STATUS_HTML5_MEDIA);
461 return; 470 return;
462 default: 471 default:
463 LOG(DFATAL) << "Invalid reason " << reason 472 LOG(DFATAL) << "Invalid reason " << reason
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 return; 532 return;
524 533
525 size_t private_bytes, shared_bytes; 534 size_t private_bytes, shared_bytes;
526 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) { 535 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) {
527 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024) 536 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024)
528 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED); 537 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED);
529 } 538 }
530 } 539 }
531 540
532 } // namespace prerender 541 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.h ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698