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

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

Issue 1977303003: Adds a feature to MHTML serialization that omits subframes and subresources marked no-store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-store
Patch Set: Adds a test that compares actual visible content. Created 4 years, 7 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 break; 379 break;
380 380
381 default: 381 default:
382 ASSERT_NOT_REACHED(); 382 ASSERT_NOT_REACHED();
383 } 383 }
384 } 384 }
385 385
386 bool FrameSerializer::shouldAddURL(const KURL& url) 386 bool FrameSerializer::shouldAddURL(const KURL& url)
387 { 387 {
388 return url.isValid() && !m_resourceURLs.contains(url) && !url.protocolIsData () 388 return url.isValid() && !m_resourceURLs.contains(url) && !url.protocolIsData ()
389 && !m_delegate.shouldSkipResource(url); 389 && !m_delegate.shouldSkipResourceWithURL(url);
390 } 390 }
391 391
392 void FrameSerializer::addToResources(Resource* resource, PassRefPtr<SharedBuffer > data, const KURL& url) 392 void FrameSerializer::addToResources(Resource* resource, PassRefPtr<SharedBuffer > data, const KURL& url)
393 { 393 {
394 if (m_delegate.shouldSkipResource(resource))
395 return;
396
397 DLOG(ERROR) << "Adding " << url.getString() << " to resources!";
Łukasz Anforowicz 2016/05/19 17:00:13 I assume this is temporary (i.e. for printf-style
dewittj 2016/05/19 18:18:36 Done.
398
394 if (!data) { 399 if (!data) {
395 DLOG(ERROR) << "No data for resource " << url.getString(); 400 DLOG(ERROR) << "No data for resource " << url.getString();
396 return; 401 return;
397 } 402 }
398 403
399 String mimeType = resource->response().mimeType(); 404 String mimeType = resource->response().mimeType();
400 m_resources->append(SerializedResource(url, mimeType, data)); 405 m_resources->append(SerializedResource(url, mimeType, data));
401 m_resourceURLs.add(url); 406 m_resourceURLs.add(url);
402 } 407 }
403 408
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 continue; 481 continue;
477 } 482 }
478 emitsMinus = ch == '-'; 483 emitsMinus = ch == '-';
479 builder.append(ch); 484 builder.append(ch);
480 } 485 }
481 CString escapedUrl = builder.toString().ascii(); 486 CString escapedUrl = builder.toString().ascii();
482 return String::format("saved from url=(%04d)%s", static_cast<int>(escapedUrl .length()), escapedUrl.data()); 487 return String::format("saved from url=(%04d)%s", static_cast<int>(escapedUrl .length()), escapedUrl.data());
483 } 488 }
484 489
485 } // namespace blink 490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698