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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameSerializer.cpp

Issue 2886943003: [Offline Pages] Adding missing image/CSS detection in FrameSerializer. (Closed)
Patch Set: comments from dcheng@. Created 3 years, 6 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 CString frame_html = 295 CString frame_html =
296 document.Encoding().Encode(text, WTF::kEntitiesForUnencodables); 296 document.Encoding().Encode(text, WTF::kEntitiesForUnencodables);
297 resources_->push_back(SerializedResource( 297 resources_->push_back(SerializedResource(
298 url, document.SuggestedMIMEType(), 298 url, document.SuggestedMIMEType(),
299 SharedBuffer::Create(frame_html.data(), frame_html.length()))); 299 SharedBuffer::Create(frame_html.data(), frame_html.length())));
300 } 300 }
301 301
302 for (Node* node : serialized_nodes) { 302 for (Node* node : serialized_nodes) {
303 DCHECK(node); 303 DCHECK(node);
304 delegate_.VisitNode(node);
fgorski 2017/05/30 17:37:50 where is the corresponding call to visiting done?
romax 2017/06/01 20:00:06 Done.
304 if (!node->IsElementNode()) 305 if (!node->IsElementNode())
305 continue; 306 continue;
306 307
307 Element& element = ToElement(*node); 308 Element& element = ToElement(*node);
308 // We have to process in-line style as it might contain some resources 309 // We have to process in-line style as it might contain some resources
309 // (typically background images). 310 // (typically background images).
310 if (element.IsStyledElement()) { 311 if (element.IsStyledElement()) {
311 RetrieveResourcesForProperties(element.InlineStyle(), document); 312 RetrieveResourcesForProperties(element.InlineStyle(), document);
312 RetrieveResourcesForProperties(element.PresentationAttributeStyle(), 313 RetrieveResourcesForProperties(element.PresentationAttributeStyle(),
313 document); 314 document);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 emits_minus = ch == '-'; 580 emits_minus = ch == '-';
580 builder.Append(ch); 581 builder.Append(ch);
581 } 582 }
582 CString escaped_url = builder.ToString().Ascii(); 583 CString escaped_url = builder.ToString().Ascii();
583 return String::Format("saved from url=(%04d)%s", 584 return String::Format("saved from url=(%04d)%s",
584 static_cast<int>(escaped_url.length()), 585 static_cast<int>(escaped_url.length()),
585 escaped_url.data()); 586 escaped_url.data());
586 } 587 }
587 588
588 } // namespace blink 589 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698