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

Side by Side Diff: Source/core/page/PageSerializer.cpp

Issue 1238943004: CSSValue Immediates: Replace CSSValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 void PageSerializer::retrieveResourcesForProperties(const StylePropertySet* styl eDeclaration, Document& document) 514 void PageSerializer::retrieveResourcesForProperties(const StylePropertySet* styl eDeclaration, Document& document)
515 { 515 {
516 if (!styleDeclaration) 516 if (!styleDeclaration)
517 return; 517 return;
518 518
519 // The background-image and list-style-image (for ul or ol) are the CSS prop erties 519 // The background-image and list-style-image (for ul or ol) are the CSS prop erties
520 // that make use of images. We iterate to make sure we include any other 520 // that make use of images. We iterate to make sure we include any other
521 // image properties there might be. 521 // image properties there might be.
522 unsigned propertyCount = styleDeclaration->propertyCount(); 522 unsigned propertyCount = styleDeclaration->propertyCount();
523 for (unsigned i = 0; i < propertyCount; ++i) { 523 for (unsigned i = 0; i < propertyCount; ++i) {
524 CSSValue cssValue = styleDeclaration->propertyAt(i).value(); 524 const CSSValue& cssValue = styleDeclaration->propertyAt(i).value();
525 retrieveResourcesForCSSValue(cssValue, document); 525 retrieveResourcesForCSSValue(cssValue, document);
526 } 526 }
527 } 527 }
528 528
529 void PageSerializer::retrieveResourcesForCSSValue(CSSValue cssValue, Document& d ocument) 529 void PageSerializer::retrieveResourcesForCSSValue(const CSSValue& cssValue, Docu ment& document)
530 { 530 {
531 if (cssValue.isImageValue()) { 531 if (cssValue.isImageValue()) {
532 CSSImageValue& imageValue = toCSSImageValue(cssValue); 532 CSSImageValue& imageValue = toCSSImageValue(cssValue);
533 StyleImage* styleImage = imageValue.cachedOrPendingImage(); 533 StyleImage* styleImage = imageValue.cachedOrPendingImage();
534 // Non cached-images are just place-holders and do not contain data. 534 // Non cached-images are just place-holders and do not contain data.
535 if (!styleImage || !styleImage->isImageResource()) 535 if (!styleImage || !styleImage->isImageResource())
536 return; 536 return;
537 537
538 addImageToResources(styleImage->cachedImage(), nullptr, styleImage->cach edImage()->url()); 538 addImageToResources(styleImage->cachedImage(), nullptr, styleImage->cach edImage()->url());
539 } else if (cssValue.isFontFaceSrcValue()) { 539 } else if (cssValue.isFontFaceSrcValue()) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 571
572 return fakeURL; 572 return fakeURL;
573 } 573 }
574 574
575 PageSerializer::Delegate* PageSerializer::delegate() 575 PageSerializer::Delegate* PageSerializer::delegate()
576 { 576 {
577 return m_delegate.get(); 577 return m_delegate.get();
578 } 578 }
579 579
580 } // namespace blink 580 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/PageSerializer.h ('k') | Source/modules/canvas2d/CanvasRenderingContext2DState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698