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

Side by Side Diff: Source/core/css/CSSStyleSheet.cpp

Issue 196653006: Optimize StyleSheetContents::checkLoaded by keeping track of completed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 6 years, 9 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
« no previous file with comments | « Source/core/css/CSSStyleSheet.h ('k') | Source/core/css/StyleSheetContents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 409 }
410 410
411 void CSSStyleSheet::clearChildRuleCSSOMWrappers() 411 void CSSStyleSheet::clearChildRuleCSSOMWrappers()
412 { 412 {
413 m_childRuleCSSOMWrappers.clear(); 413 m_childRuleCSSOMWrappers.clear();
414 } 414 }
415 415
416 bool CSSStyleSheet::sheetLoaded() 416 bool CSSStyleSheet::sheetLoaded()
417 { 417 {
418 ASSERT(m_ownerNode); 418 ASSERT(m_ownerNode);
419 m_loadCompleted = m_ownerNode->sheetLoaded(); 419 setLoadCompleted(m_ownerNode->sheetLoaded());
420 return m_loadCompleted; 420 return m_loadCompleted;
421 } 421 }
422 422
423 void CSSStyleSheet::startLoadingDynamicSheet() 423 void CSSStyleSheet::startLoadingDynamicSheet()
424 { 424 {
425 m_loadCompleted = false; 425 setLoadCompleted(false);
426 m_ownerNode->startLoadingDynamicSheet(); 426 m_ownerNode->startLoadingDynamicSheet();
427 } 427 }
428 428
429 void CSSStyleSheet::setLoadCompleted(bool completed)
430 {
431 if (completed == m_loadCompleted)
432 return;
433
434 m_loadCompleted = completed;
435
436 if (completed)
437 m_contents->clientLoadCompleted(this);
438 else
439 m_contents->clientLoadStarted(this);
440 }
441
429 void CSSStyleSheet::trace(Visitor* visitor) 442 void CSSStyleSheet::trace(Visitor* visitor)
430 { 443 {
431 visitor->trace(m_contents); 444 visitor->trace(m_contents);
432 visitor->trace(m_mediaQueries); 445 visitor->trace(m_mediaQueries);
433 visitor->trace(m_ownerRule); 446 visitor->trace(m_ownerRule);
434 visitor->trace(m_mediaCSSOMWrapper); 447 visitor->trace(m_mediaCSSOMWrapper);
435 visitor->trace(m_childRuleCSSOMWrappers); 448 visitor->trace(m_childRuleCSSOMWrappers);
436 visitor->trace(m_ruleListCSSOMWrapper); 449 visitor->trace(m_ruleListCSSOMWrapper);
437 } 450 }
438 451
439 } 452 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSStyleSheet.h ('k') | Source/core/css/StyleSheetContents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698