| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 bool isPartial; | 290 bool isPartial; |
| 291 unsigned needsLayoutObjects; | 291 unsigned needsLayoutObjects; |
| 292 unsigned totalObjects; | 292 unsigned totalObjects; |
| 293 contextFrame->countObjectsNeedingLayout(needsLayoutObjects, totalObjects, is
Partial); | 293 contextFrame->countObjectsNeedingLayout(needsLayoutObjects, totalObjects, is
Partial); |
| 294 return needsLayoutObjects; | 294 return needsLayoutObjects; |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool Internals::isPreloaded(const String& url) | 297 bool Internals::isPreloaded(const String& url) |
| 298 { | 298 { |
| 299 Document* document = contextDocument(); | 299 return isPreloadedBy(url, contextDocument()); |
| 300 } |
| 301 |
| 302 bool Internals::isPreloadedBy(const String& url, Document* document) |
| 303 { |
| 304 if (!document) |
| 305 return false; |
| 300 return document->fetcher()->isPreloaded(url); | 306 return document->fetcher()->isPreloaded(url); |
| 301 } | 307 } |
| 302 | 308 |
| 303 bool Internals::isLoadingFromMemoryCache(const String& url) | 309 bool Internals::isLoadingFromMemoryCache(const String& url) |
| 304 { | 310 { |
| 305 if (!contextDocument()) | 311 if (!contextDocument()) |
| 306 return false; | 312 return false; |
| 307 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple
teURL(url)); | 313 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple
teURL(url)); |
| 308 return resource && resource->status() == Resource::Cached; | 314 return resource && resource->status() == Resource::Cached; |
| 309 } | 315 } |
| (...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2377 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
| 2372 { | 2378 { |
| 2373 if (!node) | 2379 if (!node) |
| 2374 return String(); | 2380 return String(); |
| 2375 blink::WebPoint point(x, y); | 2381 blink::WebPoint point(x, y); |
| 2376 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2382 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
| 2377 return surroundingText.content(); | 2383 return surroundingText.content(); |
| 2378 } | 2384 } |
| 2379 | 2385 |
| 2380 } | 2386 } |
| OLD | NEW |