OLD | NEW |
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 } | 345 } |
346 | 346 |
347 void FrameSerializer::serializeCSSStyleSheet(CSSStyleSheet& styleSheet, | 347 void FrameSerializer::serializeCSSStyleSheet(CSSStyleSheet& styleSheet, |
348 const KURL& url) { | 348 const KURL& url) { |
349 // If the URL is invalid or if it is a data URL this means that this CSS is | 349 // If the URL is invalid or if it is a data URL this means that this CSS is |
350 // defined inline, respectively in a <style> tag or in the data URL itself. | 350 // defined inline, respectively in a <style> tag or in the data URL itself. |
351 bool isInlineCss = !url.isValid() || url.protocolIsData(); | 351 bool isInlineCss = !url.isValid() || url.protocolIsData(); |
352 // If this CSS is not inline then it is identifiable by its URL. So just skip | 352 // If this CSS is not inline then it is identifiable by its URL. So just skip |
353 // it if it has already been analyzed before. | 353 // it if it has already been analyzed before. |
354 if (!isInlineCss && (m_resourceURLs.contains(url) || | 354 if (!isInlineCss && |
355 m_delegate.shouldSkipResourceWithURL(url))) { | 355 (m_resourceURLs.contains(url) || |
| 356 m_delegate.shouldSkipResourceWithURL(url))) { |
356 return; | 357 return; |
357 } | 358 } |
358 | 359 |
359 TRACE_EVENT2("page-serialization", "FrameSerializer::serializeCSSStyleSheet", | 360 TRACE_EVENT2("page-serialization", "FrameSerializer::serializeCSSStyleSheet", |
360 "type", "CSS", "url", url.elidedString().utf8().data()); | 361 "type", "CSS", "url", url.elidedString().utf8().data()); |
361 // Only report UMA metric if this is not a reentrant CSS serialization call. | 362 // Only report UMA metric if this is not a reentrant CSS serialization call. |
362 double cssStartTime = 0; | 363 double cssStartTime = 0; |
363 if (!m_isSerializingCss) { | 364 if (!m_isSerializingCss) { |
364 m_isSerializingCss = true; | 365 m_isSerializingCss = true; |
365 cssStartTime = monotonicallyIncreasingTime(); | 366 cssStartTime = monotonicallyIncreasingTime(); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 emitsMinus = ch == '-'; | 581 emitsMinus = ch == '-'; |
581 builder.append(ch); | 582 builder.append(ch); |
582 } | 583 } |
583 CString escapedUrl = builder.toString().ascii(); | 584 CString escapedUrl = builder.toString().ascii(); |
584 return String::format("saved from url=(%04d)%s", | 585 return String::format("saved from url=(%04d)%s", |
585 static_cast<int>(escapedUrl.length()), | 586 static_cast<int>(escapedUrl.length()), |
586 escapedUrl.data()); | 587 escapedUrl.data()); |
587 } | 588 } |
588 | 589 |
589 } // namespace blink | 590 } // namespace blink |
OLD | NEW |