OLD | NEW |
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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "platform/TracedValue.h" | 66 #include "platform/TracedValue.h" |
67 #include "platform/mhtml/MHTMLArchive.h" | 67 #include "platform/mhtml/MHTMLArchive.h" |
68 #include "platform/network/ResourceLoadPriority.h" | 68 #include "platform/network/ResourceLoadPriority.h" |
69 #include "platform/network/ResourceTimingInfo.h" | 69 #include "platform/network/ResourceTimingInfo.h" |
70 #include "platform/weborigin/SchemeRegistry.h" | 70 #include "platform/weborigin/SchemeRegistry.h" |
71 #include "platform/weborigin/SecurityPolicy.h" | 71 #include "platform/weborigin/SecurityPolicy.h" |
72 #include "public/platform/WebCachePolicy.h" | 72 #include "public/platform/WebCachePolicy.h" |
73 #include "public/platform/WebDocumentSubresourceFilter.h" | 73 #include "public/platform/WebDocumentSubresourceFilter.h" |
74 #include "public/platform/WebFrameScheduler.h" | 74 #include "public/platform/WebFrameScheduler.h" |
75 #include "public/platform/WebInsecureRequestPolicy.h" | 75 #include "public/platform/WebInsecureRequestPolicy.h" |
76 | |
77 #include <algorithm> | 76 #include <algorithm> |
| 77 #include <memory> |
78 | 78 |
79 namespace blink { | 79 namespace blink { |
80 | 80 |
81 namespace { | 81 namespace { |
82 | 82 |
83 bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request, Fetch
Request::DeferOption defer, const Document& document) | 83 bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request, Fetch
Request::DeferOption defer, const Document& document) |
84 { | 84 { |
85 // Only scripts inserted via document.write are candidates for having their | 85 // Only scripts inserted via document.write are candidates for having their |
86 // fetch disallowed. | 86 // fetch disallowed. |
87 if (!document.isInDocumentWrite()) | 87 if (!document.isInDocumentWrite()) |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const | 391 bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const |
392 { | 392 { |
393 if (!m_documentLoader) | 393 if (!m_documentLoader) |
394 return true; | 394 return true; |
395 if (type == Resource::MainResource) | 395 if (type == Resource::MainResource) |
396 return m_documentLoader == frame()->loader().provisionalDocumentLoader()
; | 396 return m_documentLoader == frame()->loader().provisionalDocumentLoader()
; |
397 return m_documentLoader == frame()->loader().documentLoader(); | 397 return m_documentLoader == frame()->loader().documentLoader(); |
398 } | 398 } |
399 | 399 |
400 static PassOwnPtr<TracedValue> loadResourceTraceData(unsigned long identifier, c
onst KURL& url, int priority) | 400 static std::unique_ptr<TracedValue> loadResourceTraceData(unsigned long identifi
er, const KURL& url, int priority) |
401 { | 401 { |
402 String requestId = IdentifiersFactory::requestId(identifier); | 402 String requestId = IdentifiersFactory::requestId(identifier); |
403 | 403 |
404 OwnPtr<TracedValue> value = TracedValue::create(); | 404 std::unique_ptr<TracedValue> value = TracedValue::create(); |
405 value->setString("requestId", requestId); | 405 value->setString("requestId", requestId); |
406 value->setString("url", url.getString()); | 406 value->setString("url", url.getString()); |
407 value->setInteger("priority", priority); | 407 value->setInteger("priority", priority); |
408 return value; | 408 return value; |
409 } | 409 } |
410 | 410 |
411 void FrameFetchContext::willStartLoadingResource(unsigned long identifier, Resou
rceRequest& request, Resource::Type type) | 411 void FrameFetchContext::willStartLoadingResource(unsigned long identifier, Resou
rceRequest& request, Resource::Type type) |
412 { | 412 { |
413 TRACE_EVENT_ASYNC_BEGIN1("blink.net", "Resource", identifier, "data", loadRe
sourceTraceData(identifier, request.url(), request.priority())); | 413 TRACE_EVENT_ASYNC_BEGIN1("blink.net", "Resource", identifier, "data", loadRe
sourceTraceData(identifier, request.url(), request.priority())); |
414 prepareRequest(identifier, request, ResourceResponse()); | 414 prepareRequest(identifier, request, ResourceResponse()); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 773 } |
774 | 774 |
775 DEFINE_TRACE(FrameFetchContext) | 775 DEFINE_TRACE(FrameFetchContext) |
776 { | 776 { |
777 visitor->trace(m_document); | 777 visitor->trace(m_document); |
778 visitor->trace(m_documentLoader); | 778 visitor->trace(m_documentLoader); |
779 FetchContext::trace(visitor); | 779 FetchContext::trace(visitor); |
780 } | 780 } |
781 | 781 |
782 } // namespace blink | 782 } // namespace blink |
OLD | NEW |