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

Side by Side Diff: Source/core/html/parser/HTMLResourcePreloader.cpp

Issue 108313015: Make calls to AtomicString(const String&) explicit in html/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take feedback into consideration Created 6 years, 11 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) 2013 Google Inc. All Rights Reserved. 2 * Copyright (C) 2013 Google Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 KURL PreloadRequest::completeURL(Document* document) 49 KURL PreloadRequest::completeURL(Document* document)
50 { 50 {
51 return document->completeURL(m_resourceURL, m_baseURL.isEmpty() ? document-> url() : m_baseURL); 51 return document->completeURL(m_resourceURL, m_baseURL.isEmpty() ? document-> url() : m_baseURL);
52 } 52 }
53 53
54 FetchRequest PreloadRequest::resourceRequest(Document* document) 54 FetchRequest PreloadRequest::resourceRequest(Document* document)
55 { 55 {
56 ASSERT(isMainThread()); 56 ASSERT(isMainThread());
57 FetchInitiatorInfo initiatorInfo; 57 FetchInitiatorInfo initiatorInfo;
58 initiatorInfo.name = m_initiatorName; 58 initiatorInfo.name = AtomicString(m_initiatorName);
59 initiatorInfo.position = m_initiatorPosition; 59 initiatorInfo.position = m_initiatorPosition;
60 FetchRequest request(ResourceRequest(completeURL(document)), initiatorInfo); 60 FetchRequest request(ResourceRequest(completeURL(document)), initiatorInfo);
61 61
62 if (m_isCORSEnabled) 62 if (m_isCORSEnabled)
63 request.setCrossOriginAccessControl(document->securityOrigin(), m_allowC redentials); 63 request.setCrossOriginAccessControl(document->securityOrigin(), m_allowC redentials);
64 return request; 64 return request;
65 } 65 }
66 66
67 void HTMLResourcePreloader::takeAndPreload(PreloadRequestStream& r) 67 void HTMLResourcePreloader::takeAndPreload(PreloadRequestStream& r)
68 { 68 {
(...skipping 22 matching lines...) Expand all
91 if (!preload->media().isEmpty() && !mediaAttributeMatches(executingDocument- >frame(), executingDocument->renderer()->style(), preload->media())) 91 if (!preload->media().isEmpty() && !mediaAttributeMatches(executingDocument- >frame(), executingDocument->renderer()->style(), preload->media()))
92 return; 92 return;
93 93
94 FetchRequest request = preload->resourceRequest(m_document); 94 FetchRequest request = preload->resourceRequest(m_document);
95 blink::Platform::current()->histogramCustomCounts("WebCore.PreloadDelayMs", static_cast<int>(1000 * (monotonicallyIncreasingTime() - preload->discoveryTime( ))), 0, 2000, 20); 95 blink::Platform::current()->histogramCustomCounts("WebCore.PreloadDelayMs", static_cast<int>(1000 * (monotonicallyIncreasingTime() - preload->discoveryTime( ))), 0, 2000, 20);
96 loadingDocument->fetcher()->preload(preload->resourceType(), request, preloa d->charset()); 96 loadingDocument->fetcher()->preload(preload->resourceType(), request, preloa d->charset());
97 } 97 }
98 98
99 99
100 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698