| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 const String cacheIdentifier = m_document->fetcher()->getCacheIdentifier(); | 423 const String cacheIdentifier = m_document->fetcher()->getCacheIdentifier(); |
| 424 Resource* resource = memoryCache()->resourceForURL( | 424 Resource* resource = memoryCache()->resourceForURL( |
| 425 m_document->completeURL(url), cacheIdentifier); | 425 m_document->completeURL(url), cacheIdentifier); |
| 426 return resource && resource->getStatus() == ResourceStatus::Cached; | 426 return resource && resource->getStatus() == ResourceStatus::Cached; |
| 427 } | 427 } |
| 428 | 428 |
| 429 int Internals::getResourcePriority(const String& url, Document* document) { | 429 int Internals::getResourcePriority(const String& url, Document* document) { |
| 430 if (!document) | 430 if (!document) |
| 431 return ResourceLoadPriority::ResourceLoadPriorityUnresolved; | 431 return ResourceLoadPriority::ResourceLoadPriorityUnresolved; |
| 432 | 432 |
| 433 Resource* resource = document->fetcher()->allResources().get( | 433 Resource* resource = document->fetcher()->allResources().at( |
| 434 URLTestHelpers::toKURL(url.utf8().data())); | 434 URLTestHelpers::toKURL(url.utf8().data())); |
| 435 | 435 |
| 436 if (!resource) | 436 if (!resource) |
| 437 return ResourceLoadPriority::ResourceLoadPriorityUnresolved; | 437 return ResourceLoadPriority::ResourceLoadPriorityUnresolved; |
| 438 | 438 |
| 439 return resource->resourceRequest().priority(); | 439 return resource->resourceRequest().priority(); |
| 440 } | 440 } |
| 441 | 441 |
| 442 String Internals::getResourceHeader(const String& url, | 442 String Internals::getResourceHeader(const String& url, |
| 443 const String& header, | 443 const String& header, |
| 444 Document* document) { | 444 Document* document) { |
| 445 if (!document) | 445 if (!document) |
| 446 return String(); | 446 return String(); |
| 447 Resource* resource = document->fetcher()->allResources().get( | 447 Resource* resource = document->fetcher()->allResources().at( |
| 448 URLTestHelpers::toKURL(url.utf8().data())); | 448 URLTestHelpers::toKURL(url.utf8().data())); |
| 449 if (!resource) | 449 if (!resource) |
| 450 return String(); | 450 return String(); |
| 451 return resource->resourceRequest().httpHeaderField(header.utf8().data()); | 451 return resource->resourceRequest().httpHeaderField(header.utf8().data()); |
| 452 } | 452 } |
| 453 | 453 |
| 454 bool Internals::isSharingStyle(Element* element1, Element* element2) const { | 454 bool Internals::isSharingStyle(Element* element1, Element* element2) const { |
| 455 DCHECK(element1 && element2); | 455 DCHECK(element1 && element2); |
| 456 return element1->computedStyle() == element2->computedStyle(); | 456 return element1->computedStyle() == element2->computedStyle(); |
| 457 } | 457 } |
| (...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3172 | 3172 |
| 3173 void Internals::crash() { | 3173 void Internals::crash() { |
| 3174 CHECK(false) << "Intentional crash"; | 3174 CHECK(false) << "Intentional crash"; |
| 3175 } | 3175 } |
| 3176 | 3176 |
| 3177 void Internals::setIsLowEndDevice(bool isLowEndDevice) { | 3177 void Internals::setIsLowEndDevice(bool isLowEndDevice) { |
| 3178 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); | 3178 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); |
| 3179 } | 3179 } |
| 3180 | 3180 |
| 3181 } // namespace blink | 3181 } // namespace blink |
| OLD | NEW |