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

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

Issue 640463003: MemoryCache: Enable MemoryCache to have multiple isolated resource maps (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remake Created 6 years, 2 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
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 bool Internals::isPreloaded(const String& url) 347 bool Internals::isPreloaded(const String& url)
348 { 348 {
349 Document* document = contextDocument(); 349 Document* document = contextDocument();
350 return document->fetcher()->isPreloaded(url); 350 return document->fetcher()->isPreloaded(url);
351 } 351 }
352 352
353 bool Internals::isLoadingFromMemoryCache(const String& url) 353 bool Internals::isLoadingFromMemoryCache(const String& url)
354 { 354 {
355 if (!contextDocument()) 355 if (!contextDocument())
356 return false; 356 return false;
357 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple teURL(url)); 357 // FIXME: There is no way to get the right cache key here. This function is
358 // only used for testing, so the default identifier should be ok for now.
Mike West 2014/10/24 12:43:00 Doesn't this mean you're not going to get the corr
nhiroki 2014/10/27 14:30:13 I found the way to get the key here, so removed th
359 const String cacheIdentifier = MemoryCache::defaultCacheIdentifier();
360 Resource* resource = memoryCache()->resourceForURL(cacheIdentifier, contextD ocument()->completeURL(url));
358 return resource && resource->status() == Resource::Cached; 361 return resource && resource->status() == Resource::Cached;
359 } 362 }
360 363
361 bool Internals::isSharingStyle(Element* element1, Element* element2) const 364 bool Internals::isSharingStyle(Element* element1, Element* element2) const
362 { 365 {
363 ASSERT(element1 && element2); 366 ASSERT(element1 && element2);
364 return element1->renderStyle() == element2->renderStyle(); 367 return element1->renderStyle() == element2->renderStyle();
365 } 368 }
366 369
367 bool Internals::isValidContentSelect(Element* insertionPoint, ExceptionState& ex ceptionState) 370 bool Internals::isValidContentSelect(Element* insertionPoint, ExceptionState& ex ceptionState)
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 } 2287 }
2285 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options)); 2288 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options));
2286 } 2289 }
2287 2290
2288 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState) 2291 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState)
2289 { 2292 {
2290 return new InternalsIterator; 2293 return new InternalsIterator;
2291 } 2294 }
2292 2295
2293 } // namespace blink 2296 } // namespace blink
OLDNEW
« Source/core/fetch/ResourceFetcher.cpp ('K') | « Source/core/loader/ImageLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698