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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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)) | |
Łukasz Anforowicz
2016/05/18 17:27:25
I wonder if we can skip processing a resource befo
dewittj
2016/05/19 04:13:17
I am not sure how we could get the URL (or indeed
Łukasz Anforowicz
2016/05/19 17:00:13
You're right - fetching is unavoidable, but we can
dewittj
2016/05/19 18:18:35
Does this actually cause a copy? It looks like it
Łukasz Anforowicz
2016/05/19 18:50:17
My bad - you're right, this is just a ref-count in
| |
395 return; | |
396 | |
394 if (!data) { | 397 if (!data) { |
395 DLOG(ERROR) << "No data for resource " << url.getString(); | 398 DLOG(ERROR) << "No data for resource " << url.getString(); |
396 return; | 399 return; |
397 } | 400 } |
398 | 401 |
399 String mimeType = resource->response().mimeType(); | 402 String mimeType = resource->response().mimeType(); |
400 m_resources->append(SerializedResource(url, mimeType, data)); | 403 m_resources->append(SerializedResource(url, mimeType, data)); |
401 m_resourceURLs.add(url); | 404 m_resourceURLs.add(url); |
402 } | 405 } |
403 | 406 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
476 continue; | 479 continue; |
477 } | 480 } |
478 emitsMinus = ch == '-'; | 481 emitsMinus = ch == '-'; |
479 builder.append(ch); | 482 builder.append(ch); |
480 } | 483 } |
481 CString escapedUrl = builder.toString().ascii(); | 484 CString escapedUrl = builder.toString().ascii(); |
482 return String::format("saved from url=(%04d)%s", static_cast<int>(escapedUrl .length()), escapedUrl.data()); | 485 return String::format("saved from url=(%04d)%s", static_cast<int>(escapedUrl .length()), escapedUrl.data()); |
483 } | 486 } |
484 | 487 |
485 } // namespace blink | 488 } // namespace blink |
OLD | NEW |