+2011-08-26 Nate Chapin <japhet@chromium.org>
+
+ Change a bunch of nondescript bools to
+ descriptive enums in ResourceLoaderOptions and
+ ThreadableLoaderOptions.
+ https://bugs.webkit.org/show_bug.cgi?id=66984
+
+ Reviewed by David Levin.
+
+ No new tests, no functionality change intended.
+
+ * WebCore.exp.in:
+ * fileapi/FileReaderLoader.cpp:
+ * html/MediaDocument.cpp:
+ * html/PluginDocument.cpp:
+ * loader/CrossOriginAccessControl.cpp:
+ * loader/CrossOriginAccessControl.h:
+ * loader/CrossOriginPreflightResultCache.cpp:
+ * loader/CrossOriginPreflightResultCache.h:
+ * loader/DocumentThreadableLoader.cpp:
+ * loader/FrameLoader.h:
+ * loader/ImageLoader.cpp:
+ * loader/MainResourceLoader.cpp:
+ * loader/NetscapePlugInStreamLoader.cpp:
+ * loader/ResourceLoadScheduler.h:
+ * loader/ResourceLoader.cpp:
+ * loader/ResourceLoader.h:
+ * loader/ResourceLoaderOptions.h:
+ * loader/ThreadableLoader.h:
+ * loader/cache/CachedResource.cpp:
+ * loader/cache/CachedResourceRequest.cpp:
+ * loader/cf/ResourceLoaderCFNet.cpp:
+ * loader/mac/ResourceLoaderMac.mm:
+ * page/EventSource.cpp:
+ * platform/network/ResourceHandle.h:
+ * workers/WorkerScriptLoader.cpp:
+ * xml/XMLHttpRequest.cpp:
+
2011-08-26 Andreas Kling <kling@webkit.org>
HTMLMetaElement: Don't cache "http-equiv" and "content" attributes.
__ZN7WebCore14ResourceHandle20forceContentSniffingEv
__ZN7WebCore14ResourceHandle26synchronousLoadRunLoopModeEv
__ZN7WebCore14ResourceLoader14cancelledErrorEv
-__ZN7WebCore14ResourceLoader19setShouldBufferDataEb
__ZN7WebCore14SVGSMILElement13isSMILElementEPNS_4NodeE
__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKN3WTF6StringE
#include "npruntime_priv.h"
#include "NPV8Object.h"
#include "ScriptSourceCode.h"
+#include "SecurityOrigin.h"
#include "Settings.h"
#include "UserGestureIndicator.h"
#include "V8Binding.h"
request.setHTTPMethod("GET");
ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
+ options.sendLoadCallbacks = SendCallbacks;
+ options.sniffContent = DoNotSniffContent;
options.preflightPolicy = ConsiderPreflight;
- options.allowCredentials = true;
+ options.allowCredentials = AllowStoredCredentials;
options.crossOriginRequestPolicy = DenyCrossOriginRequests;
if (m_client)
if (!frame)
return;
- frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(false);
+ frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(DoNotBufferData);
}
void MediaDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
// In a plugin document, the main resource is the plugin. If we have a null widget, that means
// the loading of the plugin was cancelled, which gives us a null mainResourceLoader(), so we
// need to have this call in a null check of the widget or of mainResourceLoader().
- frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(false);
+ frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(DoNotBufferData);
}
}
return allowedCrossOriginResponseHeaders->contains(name);
}
-void updateRequestForAccessControl(ResourceRequest& request, SecurityOrigin* securityOrigin, bool allowCredentials)
+void updateRequestForAccessControl(ResourceRequest& request, SecurityOrigin* securityOrigin, StoredCredentials allowCredentials)
{
request.removeCredentials();
- request.setAllowCookies(allowCredentials);
+ request.setAllowCookies(allowCredentials == AllowStoredCredentials);
request.setHTTPOrigin(securityOrigin->toString());
}
-ResourceRequest createAccessControlPreflightRequest(const ResourceRequest& request, SecurityOrigin* securityOrigin, bool allowCredentials)
+ResourceRequest createAccessControlPreflightRequest(const ResourceRequest& request, SecurityOrigin* securityOrigin, StoredCredentials allowCredentials)
{
ResourceRequest preflightRequest(request.url());
updateRequestForAccessControl(preflightRequest, securityOrigin, allowCredentials);
return preflightRequest;
}
-bool passesAccessControlCheck(const ResourceResponse& response, bool includeCredentials, SecurityOrigin* securityOrigin, String& errorDescription)
+bool passesAccessControlCheck(const ResourceResponse& response, StoredCredentials includeCredentials, SecurityOrigin* securityOrigin, String& errorDescription)
{
// A wildcard Access-Control-Allow-Origin can not be used if credentials are to be sent,
// even with Access-Control-Allow-Credentials set to true.
const String& accessControlOriginString = response.httpHeaderField("Access-Control-Allow-Origin");
- if (accessControlOriginString == "*" && !includeCredentials)
+ if (accessControlOriginString == "*" && includeCredentials == DoNotAllowStoredCredentials)
return true;
if (securityOrigin->isUnique()) {
return false;
}
- if (includeCredentials) {
+ if (includeCredentials == AllowStoredCredentials) {
const String& accessControlCredentialsString = response.httpHeaderField("Access-Control-Allow-Credentials");
if (accessControlCredentialsString != "true") {
errorDescription = "Credentials flag is true, but Access-Control-Allow-Credentials is not \"true\".";
#ifndef CrossOriginAccessControl_h
#define CrossOriginAccessControl_h
+#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include <wtf/Forward.h>
bool isOnAccessControlSimpleRequestHeaderWhitelist(const String& name, const String& value);
bool isOnAccessControlResponseHeaderWhitelist(const String&);
-void updateRequestForAccessControl(ResourceRequest&, SecurityOrigin*, bool allowCredentials);
-ResourceRequest createAccessControlPreflightRequest(const ResourceRequest&, SecurityOrigin*, bool allowCredentials);
+void updateRequestForAccessControl(ResourceRequest&, SecurityOrigin*, StoredCredentials);
+ResourceRequest createAccessControlPreflightRequest(const ResourceRequest&, SecurityOrigin*, StoredCredentials);
-bool passesAccessControlCheck(const ResourceResponse&, bool includeCredentials, SecurityOrigin*, String& errorDescription);
+bool passesAccessControlCheck(const ResourceResponse&, StoredCredentials, SecurityOrigin*, String& errorDescription);
} // namespace WebCore
return true;
}
-bool CrossOriginPreflightResultCacheItem::allowsRequest(bool includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders) const
+bool CrossOriginPreflightResultCacheItem::allowsRequest(StoredCredentials includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders) const
{
String ignoredExplanation;
if (m_absoluteExpiryTime < currentTime())
return false;
- if (includeCredentials && !m_credentials)
+ if (includeCredentials == AllowStoredCredentials && m_credentials == DoNotAllowStoredCredentials)
return false;
if (!allowsCrossOriginMethod(method, ignoredExplanation))
return false;
}
}
-bool CrossOriginPreflightResultCache::canSkipPreflight(const String& origin, const KURL& url, bool includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders)
+bool CrossOriginPreflightResultCache::canSkipPreflight(const String& origin, const KURL& url, StoredCredentials includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders)
{
ASSERT(isMainThread());
CrossOriginPreflightResultHashMap::iterator cacheIt = m_preflightHashMap.find(std::make_pair(origin, url));
#define CrossOriginPreflightResultCache_h
#include "KURLHash.h"
+#include "ResourceHandle.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/PassOwnPtr.h>
class CrossOriginPreflightResultCacheItem {
WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCacheItem); WTF_MAKE_FAST_ALLOCATED;
public:
- CrossOriginPreflightResultCacheItem(bool credentials)
+ CrossOriginPreflightResultCacheItem(StoredCredentials credentials)
: m_absoluteExpiryTime(0)
, m_credentials(credentials)
{
bool parse(const ResourceResponse&, String& errorDescription);
bool allowsCrossOriginMethod(const String&, String& errorDescription) const;
bool allowsCrossOriginHeaders(const HTTPHeaderMap&, String& errorDescription) const;
- bool allowsRequest(bool includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders) const;
+ bool allowsRequest(StoredCredentials, const String& method, const HTTPHeaderMap& requestHeaders) const;
private:
typedef HashSet<String, CaseFoldingHash> HeadersSet;
// to start a timer for the expiration delta that removes this from the cache when
// it fires.
double m_absoluteExpiryTime;
- bool m_credentials;
+ StoredCredentials m_credentials;
HashSet<String> m_methods;
HeadersSet m_headers;
};
static CrossOriginPreflightResultCache& shared();
void appendEntry(const String& origin, const KURL&, PassOwnPtr<CrossOriginPreflightResultCacheItem>);
- bool canSkipPreflight(const String& origin, const KURL&, bool includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders);
+ bool canSkipPreflight(const String& origin, const KURL&, StoredCredentials, const String& method, const HTTPHeaderMap& requestHeaders);
void empty();
{
ASSERT_UNUSED(loader, loader == m_loader || !m_loader);
- if (!m_options.allowCredentials) {
+ if (m_options.allowCredentials == DoNotAllowStoredCredentials) {
shouldUseCredentialStorage = false;
return true;
}
ThreadableLoaderOptions options = m_options;
if (m_actualRequest) {
// Don't sniff content or send load callbacks for the preflight request.
- options.sendLoadCallbacks = false;
- options.sniffContent = false;
+ options.sendLoadCallbacks = DoNotSendCallbacks;
+ options.sniffContent = DoNotSniffContent;
// Keep buffering the data for the preflight request.
- options.shouldBufferData = true;
+ options.shouldBufferData = BufferData;
}
#if ENABLE(INSPECTOR)
}
// FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchronous requests.
- StoredCredentials storedCredentials = m_options.allowCredentials ? AllowStoredCredentials : DoNotAllowStoredCredentials;
-
Vector<char> data;
ResourceError error;
ResourceResponse response;
unsigned long identifier = std::numeric_limits<unsigned long>::max();
if (m_document->frame())
- identifier = m_document->frame()->loader()->loadResourceSynchronously(request, storedCredentials, error, response, data);
+ identifier = m_document->frame()->loader()->loadResourceSynchronously(request, m_options.allowCredentials, error, response, data);
// No exception for file:/// resources, see <rdar://problem/4962298>.
// Also, if we have an HTTP response, then it wasn't a network error in fact.
#include "IconController.h"
#include "IconURL.h"
#include "PolicyChecker.h"
+#include "ResourceHandle.h"
#include "ResourceLoadNotifier.h"
#include "SubframeLoader.h"
-#include "ThreadableLoader.h"
#include "Timer.h"
#include <wtf/Forward.h>
#include <wtf/HashSet.h>
String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossoriginAttr);
if (!crossOriginMode.isNull()) {
- bool allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials");
+ StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
updateRequestForAccessControl(request, document->securityOrigin(), allowCredentials);
}
namespace WebCore {
MainResourceLoader::MainResourceLoader(Frame* frame)
- : ResourceLoader(frame, ResourceLoaderOptions(true, true, true))
+ : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData))
, m_dataLoadTimer(this, &MainResourceLoader::handleDataLoadNow)
, m_loadingMultipartContent(false)
, m_waitingForContentPolicy(false)
namespace WebCore {
NetscapePlugInStreamLoader::NetscapePlugInStreamLoader(Frame* frame, NetscapePlugInStreamLoaderClient* client)
- : ResourceLoader(frame, ResourceLoaderOptions(true, true, true))
+ : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData))
, m_client(client)
{
}
PassRefPtr<NetscapePlugInStreamLoader> NetscapePlugInStreamLoader::create(Frame* frame, NetscapePlugInStreamLoaderClient* client, const ResourceRequest& request)
{
RefPtr<NetscapePlugInStreamLoader> loader(adoptRef(new NetscapePlugInStreamLoader(frame, client)));
- loader->setShouldBufferData(false);
loader->documentLoader()->addPlugInStreamLoader(loader.get());
if (!loader->init(request))
return 0;
public:
friend ResourceLoadScheduler* resourceLoadScheduler();
- PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, const ResourceLoaderOptions& = ResourceLoaderOptions(true, true, true));
+ PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, const ResourceLoaderOptions& = ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData));
PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&);
void addMainResourceLoad(ResourceLoader*);
void remove(ResourceLoader*);
}
if (!m_reachedTerminalState)
- m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent);
+ m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == SniffContent);
}
void ResourceLoader::setDefersLoading(bool defers)
return m_frame->loader();
}
-void ResourceLoader::setShouldBufferData(bool shouldBufferData)
+void ResourceLoader::setShouldBufferData(DataBufferingPolicy shouldBufferData)
{
m_options.shouldBufferData = shouldBufferData;
void ResourceLoader::addData(const char* data, int length, bool allAtOnce)
{
- if (!m_options.shouldBufferData)
+ if (m_options.shouldBufferData == DoNotBufferData)
return;
if (allAtOnce) {
ASSERT(!m_reachedTerminalState);
- if (m_options.sendLoadCallbacks) {
+ if (m_options.sendLoadCallbacks == SendCallbacks) {
if (!m_identifier) {
m_identifier = m_frame->page()->progress()->createUniqueIdentifier();
frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);
if (FormData* data = m_request.httpBody())
data->removeGeneratedFilesIfNeeded();
- if (m_options.sendLoadCallbacks)
+ if (m_options.sendLoadCallbacks == SendCallbacks)
frameLoader()->notifier()->didReceiveResponse(this, m_response);
}
// FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
// However, with today's computers and networking speeds, this won't happen in practice.
// Could be an issue with a giant local file.
- if (m_options.sendLoadCallbacks && m_frame)
+ if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
frameLoader()->notifier()->didReceiveData(this, data, length, static_cast<int>(encodedDataLength));
}
void ResourceLoader::willStopBufferingData(const char* data, int length)
{
- if (!m_options.shouldBufferData)
+ if (m_options.shouldBufferData == DoNotBufferData)
return;
ASSERT(!m_resourceData);
if (m_calledDidFinishLoad)
return;
m_calledDidFinishLoad = true;
- if (m_options.sendLoadCallbacks)
+ if (m_options.sendLoadCallbacks == SendCallbacks)
frameLoader()->notifier()->didFinishLoad(this, finishTime);
}
if (FormData* data = m_request.httpBody())
data->removeGeneratedFilesIfNeeded();
- if (m_options.sendLoadCallbacks && !m_calledDidFinishLoad)
+ if (m_options.sendLoadCallbacks == SendCallbacks && !m_calledDidFinishLoad)
frameLoader()->notifier()->didFailToLoad(this, error);
releaseResources();
m_handle = 0;
}
- if (m_options.sendLoadCallbacks && m_identifier && !m_calledDidFinishLoad)
+ if (m_options.sendLoadCallbacks == SendCallbacks && m_identifier && !m_calledDidFinishLoad)
frameLoader()->notifier()->didFailToLoad(this, nonNullError);
}
bool reachedTerminalState() const { return m_reachedTerminalState; }
- void setShouldBufferData(bool shouldBufferData);
+ void setShouldBufferData(DataBufferingPolicy);
protected:
ResourceLoader(Frame*, ResourceLoaderOptions);
namespace WebCore {
+enum SendCallbackPolicy {
+ SendCallbacks,
+ DoNotSendCallbacks
+};
+
+enum ContentSniffingPolicy {
+ SniffContent,
+ DoNotSniffContent
+};
+
+enum DataBufferingPolicy {
+ BufferData,
+ DoNotBufferData
+};
+
struct ResourceLoaderOptions {
- ResourceLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), shouldBufferData(true) { }
- ResourceLoaderOptions(bool sendLoadCallbacksArg, bool sniffContentArg, bool shouldBufferDataArg) : sendLoadCallbacks(sendLoadCallbacksArg), sniffContent(sniffContentArg), shouldBufferData(shouldBufferDataArg) { }
- bool sendLoadCallbacks;
- bool sniffContent;
- bool shouldBufferData;
+ ResourceLoaderOptions() : sendLoadCallbacks(DoNotSendCallbacks), sniffContent(DoNotSniffContent), shouldBufferData(BufferData) { }
+ ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacksArg, ContentSniffingPolicy sniffContentArg, DataBufferingPolicy shouldBufferDataArg) : sendLoadCallbacks(sendLoadCallbacksArg), sniffContent(sniffContentArg), shouldBufferData(shouldBufferDataArg) { }
+ SendCallbackPolicy sendLoadCallbacks;
+ ContentSniffingPolicy sniffContent;
+ DataBufferingPolicy shouldBufferData;
};
} // namespace WebCore
#ifndef ThreadableLoader_h
#define ThreadableLoader_h
+#include "ResourceHandle.h"
#include "ResourceLoaderOptions.h"
#include "SecurityOrigin.h"
#include <wtf/Noncopyable.h>
class ResourceResponse;
class ScriptExecutionContext;
class ThreadableLoaderClient;
-
- enum StoredCredentials {
- AllowStoredCredentials,
- DoNotAllowStoredCredentials
- };
enum CrossOriginRequestPolicy {
DenyCrossOriginRequests,
};
struct ThreadableLoaderOptions : public ResourceLoaderOptions {
- ThreadableLoaderOptions() : allowCredentials(false), preflightPolicy(ConsiderPreflight), crossOriginRequestPolicy(DenyCrossOriginRequests) { }
- bool allowCredentials; // Whether HTTP credentials and cookies are sent with the request.
+ ThreadableLoaderOptions() : allowCredentials(DoNotAllowStoredCredentials), preflightPolicy(ConsiderPreflight), crossOriginRequestPolicy(DenyCrossOriginRequests) { }
+ StoredCredentials allowCredentials; // Whether HTTP credentials and cookies are sent with the request.
PreflightPolicy preflightPolicy; // If AccessControl is used, how to determine if a preflight is needed.
CrossOriginRequestPolicy crossOriginRequestPolicy;
RefPtr<SecurityOrigin> securityOrigin;
bool CachedResource::passesAccessControlCheck(SecurityOrigin* securityOrigin)
{
String errorDescription;
- return WebCore::passesAccessControlCheck(m_response, resourceRequest().allowCookies(), securityOrigin, errorDescription);
+ return WebCore::passesAccessControlCheck(m_response, resourceRequest().allowCookies() ? AllowStoredCredentials : DoNotAllowStoredCredentials, securityOrigin, errorDescription);
}
bool CachedResource::isExpired() const
ResourceLoadPriority priority = resource->loadPriority();
resourceRequest.setPriority(priority);
- RefPtr<SubresourceLoader> loader = resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->document()->frame(),
- request.get(), resourceRequest, priority, securityCheck, ResourceLoaderOptions(sendResourceLoadCallbacks, true, true));
+ RefPtr<SubresourceLoader> loader = resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->document()->frame(), request.get(), resourceRequest, priority, securityCheck,
+ ResourceLoaderOptions(sendResourceLoadCallbacks ? SendCallbacks : DoNotSendCallbacks, SniffContent, BufferData));
if (!loader || loader->reachedTerminalState()) {
// FIXME: What if resources in other frames were waiting for this revalidation?
LOG(ResourceLoading, "Cannot start loading '%s'", resource->url().string().latin1().data());
bool ResourceLoader::shouldCacheResponse(ResourceHandle*, CFCachedURLResponseRef cachedResponse)
{
- if (!m_options.sendLoadCallbacks)
+ if (m_options.sendLoadCallbacks == DoNotSendCallbacks)
return 0;
CFURLResponseRef response = CFCachedURLResponseGetWrappedResponse(cachedResponse);
// FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
// However, with today's computers and networking speeds, this won't happen in practice.
// Could be an issue with a giant local file.
- if (m_sendResourceLoadCallbacks && m_frame)
+ if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
frameLoader()->notifier()->didReceiveData(this, reinterpret_cast<const char*>(CFDataGetBytePtr(data)), dataLen, dataLen);
}
}
setPendingActivity(this);
m_state = Loading;
ThreadableLoaderOptions options;
- options.sendLoadCallbacks = false;
- options.sniffContent = false;
+ options.sendLoadCallbacks = DoNotSendCallbacks;
+ options.sniffContent = DoNotSniffContent;
options.preflightPolicy = ConsiderPreflight;
options.allowCredentials = AllowStoredCredentials;
options.crossOriginRequestPolicy = AllowCrossOriginRequests;
request.setHTTPHeaderField("Last-Event-ID", m_lastEventId);
ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
- options.allowCredentials = true;
- options.shouldBufferData = false;
+ options.sendLoadCallbacks = SendCallbacks;
+ options.sniffContent = DoNotSniffContent;
+ options.allowCredentials = AllowStoredCredentials;
+ options.shouldBufferData = DoNotBufferData;
m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options);
#include "AuthenticationClient.h"
#include "HTTPHeaderMap.h"
#include "NetworkingContext.h"
-#include "ThreadableLoader.h"
#include <wtf/OwnPtr.h>
#if USE(SOUP)
class SchedulePair;
class SharedBuffer;
+enum StoredCredentials {
+ AllowStoredCredentials,
+ DoNotAllowStoredCredentials
+};
+
template <typename T> class Timer;
class ResourceHandle : public RefCounted<ResourceHandle>
ASSERT(scriptExecutionContext->isWorkerContext());
ThreadableLoaderOptions options;
- options.allowCredentials = true;
+ options.allowCredentials = AllowStoredCredentials;
options.crossOriginRequestPolicy = crossOriginRequestPolicy;
- options.sendLoadCallbacks = true;
+ options.sendLoadCallbacks = SendCallbacks;
WorkerThreadableLoader::loadResourceSynchronously(static_cast<WorkerContext*>(scriptExecutionContext), *request, *this, options);
}
return;
ThreadableLoaderOptions options;
- options.allowCredentials = true;
+ options.allowCredentials = AllowStoredCredentials;
options.crossOriginRequestPolicy = crossOriginRequestPolicy;
- options.sendLoadCallbacks = true;
+ options.sendLoadCallbacks = SendCallbacks;
// During create, callbacks may happen which remove the last reference to this object.
RefPtr<WorkerScriptLoader> protect(this);
request.addHTTPHeaderFields(m_requestHeaders);
ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
+ options.sendLoadCallbacks = SendCallbacks;
+ options.sniffContent = DoNotSniffContent;
options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight;
- options.allowCredentials = m_sameOriginRequest || m_includeCredentials;
+ options.allowCredentials = (m_sameOriginRequest || m_includeCredentials) ? AllowStoredCredentials : DoNotAllowStoredCredentials;
options.crossOriginRequestPolicy = UseAccessControl;
options.securityOrigin = securityOrigin();
+2011-08-26 Nate Chapin <japhet@chromium.org>
+
+ Use enums instead of bools for ThreadableLoaderOptions
+ variables.
+ https://bugs.webkit.org/show_bug.cgi?id=66984
+
+ Reviewed by David Levin.
+
+ * src/AssociatedURLLoader.cpp:
+ (WebKit::AssociatedURLLoader::loadAsynchronously):
+
2011-08-25 Jeremy Apthorp <jeremya@google.com>
Enable fullscreen API in Chromium by default.
ASSERT(m_client);
ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true; // Always send callbacks.
- options.sniffContent = m_options.sniffContent;
- options.allowCredentials = m_options.allowCredentials;
+ options.sendLoadCallbacks = SendCallbacks; // Always send callbacks.
+ options.sniffContent = m_options.sniffContent ? SniffContent : DoNotSniffContent;
+ options.allowCredentials = m_options.allowCredentials ? AllowStoredCredentials : DoNotAllowStoredCredentials;
options.preflightPolicy = m_options.forcePreflight ? ForcePreflight : ConsiderPreflight;
options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy);
- options.shouldBufferData = false;
+ options.shouldBufferData = DoNotBufferData;
const ResourceRequest& webcoreRequest = request.toResourceRequest();
Document* webcoreDocument = m_frameImpl->frame()->document();
#include "HTMLFormElement.h"
#include "HTMLHeadElement.h"
#include "NodeList.h"
-
+#include "SecurityOrigin.h"
#include "WebAccessibilityObject.h"
#include "WebDocumentType.h"
#include "WebElement.h"