| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 bool Internals::isPreloaded(const String& url) { | 400 bool Internals::isPreloaded(const String& url) { |
| 401 return isPreloadedBy(url, contextDocument()); | 401 return isPreloadedBy(url, contextDocument()); |
| 402 } | 402 } |
| 403 | 403 |
| 404 bool Internals::isPreloadedBy(const String& url, Document* document) { | 404 bool Internals::isPreloadedBy(const String& url, Document* document) { |
| 405 if (!document) | 405 if (!document) |
| 406 return false; | 406 return false; |
| 407 return document->fetcher()->isPreloadedForTest(document->completeURL(url)); | 407 return document->fetcher()->isPreloadedForTest(document->completeURL(url)); |
| 408 } | 408 } |
| 409 | 409 |
| 410 bool Internals::isLoading(const String& url) { |
| 411 if (!contextDocument()) |
| 412 return false; |
| 413 const String cacheIdentifier = |
| 414 contextDocument()->fetcher()->getCacheIdentifier(); |
| 415 Resource* resource = memoryCache()->resourceForURL( |
| 416 contextDocument()->completeURL(url), cacheIdentifier); |
| 417 // We check loader() here instead of isLoading(), because a multipart |
| 418 // ImageResource lies isLoading() == false after the first part is loaded. |
| 419 return resource && resource->loader(); |
| 420 } |
| 421 |
| 410 bool Internals::isLoadingFromMemoryCache(const String& url) { | 422 bool Internals::isLoadingFromMemoryCache(const String& url) { |
| 411 if (!contextDocument()) | 423 if (!contextDocument()) |
| 412 return false; | 424 return false; |
| 413 const String cacheIdentifier = | 425 const String cacheIdentifier = |
| 414 contextDocument()->fetcher()->getCacheIdentifier(); | 426 contextDocument()->fetcher()->getCacheIdentifier(); |
| 415 Resource* resource = memoryCache()->resourceForURL( | 427 Resource* resource = memoryCache()->resourceForURL( |
| 416 contextDocument()->completeURL(url), cacheIdentifier); | 428 contextDocument()->completeURL(url), cacheIdentifier); |
| 417 return resource && resource->getStatus() == Resource::Cached; | 429 return resource && resource->getStatus() == Resource::Cached; |
| 418 } | 430 } |
| 419 | 431 |
| (...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3082 return ClientRect::create(); | 3094 return ClientRect::create(); |
| 3083 | 3095 |
| 3084 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); | 3096 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); |
| 3085 } | 3097 } |
| 3086 | 3098 |
| 3087 void Internals::crash() { | 3099 void Internals::crash() { |
| 3088 CHECK(false) << "Intentional crash"; | 3100 CHECK(false) << "Intentional crash"; |
| 3089 } | 3101 } |
| 3090 | 3102 |
| 3091 } // namespace blink | 3103 } // namespace blink |
| OLD | NEW |