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

Side by Side Diff: Source/core/loader/DocumentThreadableLoader.cpp

Issue 360233005: Replace 'ResourceRequest::TargetType' with 'ResourceRequest::RequestContext'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Uninitialized === crash. :( Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/BeaconLoader.cpp ('k') | Source/core/loader/PingLoader.cpp » ('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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/inspector/InspectorInstrumentation.h" 42 #include "core/inspector/InspectorInstrumentation.h"
43 #include "core/inspector/InspectorTraceEvents.h" 43 #include "core/inspector/InspectorTraceEvents.h"
44 #include "core/loader/CrossOriginPreflightResultCache.h" 44 #include "core/loader/CrossOriginPreflightResultCache.h"
45 #include "core/loader/DocumentThreadableLoaderClient.h" 45 #include "core/loader/DocumentThreadableLoaderClient.h"
46 #include "core/loader/FrameLoader.h" 46 #include "core/loader/FrameLoader.h"
47 #include "core/loader/ThreadableLoaderClient.h" 47 #include "core/loader/ThreadableLoaderClient.h"
48 #include "platform/SharedBuffer.h" 48 #include "platform/SharedBuffer.h"
49 #include "platform/network/ResourceRequest.h" 49 #include "platform/network/ResourceRequest.h"
50 #include "platform/weborigin/SchemeRegistry.h" 50 #include "platform/weborigin/SchemeRegistry.h"
51 #include "platform/weborigin/SecurityOrigin.h" 51 #include "platform/weborigin/SecurityOrigin.h"
52 #include "public/platform/WebURLRequest.h"
52 #include "wtf/Assertions.h" 53 #include "wtf/Assertions.h"
53 54
54 namespace WebCore { 55 namespace WebCore {
55 56
56 void DocumentThreadableLoader::loadResourceSynchronously(Document& document, con st ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoa derOptions& options, const ResourceLoaderOptions& resourceLoaderOptions) 57 void DocumentThreadableLoader::loadResourceSynchronously(Document& document, con st ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoa derOptions& options, const ResourceLoaderOptions& resourceLoaderOptions)
57 { 58 {
58 // The loader will be deleted as soon as this function exits. 59 // The loader will be deleted as soon as this function exits.
59 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoa der(document, &client, LoadSynchronously, request, options, resourceLoaderOption s)); 60 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoa der(document, &client, LoadSynchronously, request, options, resourceLoaderOption s));
60 ASSERT(loader->hasOneRef()); 61 ASSERT(loader->hasOneRef());
61 } 62 }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (m_actualRequest) { 418 if (m_actualRequest) {
418 resourceLoaderOptions.sniffContent = DoNotSniffContent; 419 resourceLoaderOptions.sniffContent = DoNotSniffContent;
419 resourceLoaderOptions.dataBufferingPolicy = BufferData; 420 resourceLoaderOptions.dataBufferingPolicy = BufferData;
420 } 421 }
421 422
422 if (m_options.timeoutMilliseconds > 0) 423 if (m_options.timeoutMilliseconds > 0)
423 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0, FROM_HERE); 424 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0, FROM_HERE);
424 425
425 FetchRequest newRequest(request, m_options.initiator, resourceLoaderOpti ons); 426 FetchRequest newRequest(request, m_options.initiator, resourceLoaderOpti ons);
426 ASSERT(!resource()); 427 ASSERT(!resource());
427 if (request.targetType() == ResourceRequest::TargetIsMedia) 428 if (request.requestContext() == blink::WebURLRequest::RequestContextVide o || request.requestContext() == blink::WebURLRequest::RequestContextAudio)
428 setResource(m_document.fetcher()->fetchMedia(newRequest)); 429 setResource(m_document.fetcher()->fetchMedia(newRequest));
429 else 430 else
430 setResource(m_document.fetcher()->fetchRawResource(newRequest)); 431 setResource(m_document.fetcher()->fetchRawResource(newRequest));
431 if (resource() && resource()->loader()) { 432 if (resource() && resource()->loader()) {
432 unsigned long identifier = resource()->identifier(); 433 unsigned long identifier = resource()->identifier();
433 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC lient(&m_document, identifier, m_client); 434 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC lient(&m_document, identifier, m_client);
434 } 435 }
435 return; 436 return;
436 } 437 }
437 438
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 return DoNotAllowStoredCredentials; 494 return DoNotAllowStoredCredentials;
494 return m_resourceLoaderOptions.allowCredentials; 495 return m_resourceLoaderOptions.allowCredentials;
495 } 496 }
496 497
497 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const 498 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const
498 { 499 {
499 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin (); 500 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin ();
500 } 501 }
501 502
502 } // namespace WebCore 503 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/BeaconLoader.cpp ('k') | Source/core/loader/PingLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698