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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 976263002: HTML Imports: Teach preloader about HTML Imports. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 exceptionState.throwDOMException(InvalidAccessError, "Must supply docume nt to check"); 313 exceptionState.throwDOMException(InvalidAccessError, "Must supply docume nt to check");
314 return 0; 314 return 0;
315 } 315 }
316 316
317 return doc->layoutView()->hitTestCount(); 317 return doc->layoutView()->hitTestCount();
318 } 318 }
319 319
320 320
321 bool Internals::isPreloaded(const String& url) 321 bool Internals::isPreloaded(const String& url)
322 { 322 {
323 Document* document = contextDocument(); 323 return isPreloadedBy(url, contextDocument());
324 }
325
326 bool Internals::isPreloadedBy(const String& url, Document* document)
327 {
328 if (!document)
329 return false;
324 return document->fetcher()->isPreloaded(document->completeURL(url)); 330 return document->fetcher()->isPreloaded(document->completeURL(url));
325 } 331 }
326 332
327 bool Internals::isLoadingFromMemoryCache(const String& url) 333 bool Internals::isLoadingFromMemoryCache(const String& url)
328 { 334 {
329 if (!contextDocument()) 335 if (!contextDocument())
330 return false; 336 return false;
331 const String cacheIdentifier = contextDocument()->fetcher()->getCacheIdentif ier(); 337 const String cacheIdentifier = contextDocument()->fetcher()->getCacheIdentif ier();
332 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple teURL(url), cacheIdentifier); 338 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple teURL(url), cacheIdentifier);
333 return resource && resource->status() == Resource::Cached; 339 return resource && resource->status() == Resource::Cached;
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 2387
2382 ClientRectList* Internals::focusRingRects(Element* element) 2388 ClientRectList* Internals::focusRingRects(Element* element)
2383 { 2389 {
2384 Vector<LayoutRect> rects; 2390 Vector<LayoutRect> rects;
2385 if (element && element->layoutObject()) 2391 if (element && element->layoutObject())
2386 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); 2392 element->layoutObject()->addFocusRingRects(rects, LayoutPoint());
2387 return ClientRectList::create(rects); 2393 return ClientRectList::create(rects);
2388 } 2394 }
2389 2395
2390 } // namespace blink 2396 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698