OLD | NEW |
---|---|
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 30 matching lines...) Expand all Loading... | |
41 #include "core/frame/FrameConsole.h" | 41 #include "core/frame/FrameConsole.h" |
42 #include "core/frame/LocalFrame.h" | 42 #include "core/frame/LocalFrame.h" |
43 #include "core/frame/csp/ContentSecurityPolicy.h" | 43 #include "core/frame/csp/ContentSecurityPolicy.h" |
44 #include "core/inspector/InspectorInstrumentation.h" | 44 #include "core/inspector/InspectorInstrumentation.h" |
45 #include "core/inspector/InspectorTraceEvents.h" | 45 #include "core/inspector/InspectorTraceEvents.h" |
46 #include "core/loader/CrossOriginPreflightResultCache.h" | 46 #include "core/loader/CrossOriginPreflightResultCache.h" |
47 #include "core/loader/DocumentThreadableLoaderClient.h" | 47 #include "core/loader/DocumentThreadableLoaderClient.h" |
48 #include "core/loader/FrameLoader.h" | 48 #include "core/loader/FrameLoader.h" |
49 #include "core/loader/FrameLoaderClient.h" | 49 #include "core/loader/FrameLoaderClient.h" |
50 #include "core/loader/ThreadableLoaderClient.h" | 50 #include "core/loader/ThreadableLoaderClient.h" |
51 #include "core/page/ChromeClient.h" | |
52 #include "core/page/Page.h" | |
51 #include "platform/SharedBuffer.h" | 53 #include "platform/SharedBuffer.h" |
52 #include "platform/Task.h" | 54 #include "platform/Task.h" |
53 #include "platform/network/ResourceRequest.h" | 55 #include "platform/network/ResourceRequest.h" |
54 #include "platform/weborigin/SchemeRegistry.h" | 56 #include "platform/weborigin/SchemeRegistry.h" |
55 #include "platform/weborigin/SecurityOrigin.h" | 57 #include "platform/weborigin/SecurityOrigin.h" |
56 #include "public/platform/Platform.h" | 58 #include "public/platform/Platform.h" |
57 #include "public/platform/WebURLRequest.h" | 59 #include "public/platform/WebURLRequest.h" |
58 #include "wtf/Assertions.h" | 60 #include "wtf/Assertions.h" |
59 | 61 |
60 namespace blink { | 62 namespace blink { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 m_requestStartedSeconds = monotonicallyIncreasingTime(); | 154 m_requestStartedSeconds = monotonicallyIncreasingTime(); |
153 | 155 |
154 // Save any CORS simple headers on the request here. If this request redirec ts cross-origin, we cancel the old request | 156 // Save any CORS simple headers on the request here. If this request redirec ts cross-origin, we cancel the old request |
155 // create a new one, and copy these headers. | 157 // create a new one, and copy these headers. |
156 const HTTPHeaderMap& headerMap = request.httpHeaderFields(); | 158 const HTTPHeaderMap& headerMap = request.httpHeaderFields(); |
157 for (const auto& header : headerMap) { | 159 for (const auto& header : headerMap) { |
158 if (FetchUtils::isSimpleHeader(header.key, header.value)) | 160 if (FetchUtils::isSimpleHeader(header.key, header.value)) |
159 m_simpleRequestHeaders.add(header.key, header.value); | 161 m_simpleRequestHeaders.add(header.key, header.value); |
160 } | 162 } |
161 | 163 |
164 if (request.httpMethod() != "GET") | |
165 document.frame()->page()->chromeClient().observedNonGetFetchFromScript() ; | |
tyoshino (SeeGerritForStatus)
2015/09/24 08:14:11
use m_document for consistency with other users
a
kouhei (in TOK)
2015/09/25 03:22:00
Done.
| |
166 | |
162 // If the fetch request will be handled by the ServiceWorker, the | 167 // If the fetch request will be handled by the ServiceWorker, the |
163 // FetchRequestMode of the request must be FetchRequestModeCORS or | 168 // FetchRequestMode of the request must be FetchRequestModeCORS or |
164 // FetchRequestModeCORSWithForcedPreflight. Otherwise the ServiceWorker can | 169 // FetchRequestModeCORSWithForcedPreflight. Otherwise the ServiceWorker can |
165 // return a opaque response which is from the other origin site and the | 170 // return a opaque response which is from the other origin site and the |
166 // script in the page can read the content. | 171 // script in the page can read the content. |
167 // | 172 // |
168 // We assume that ServiceWorker is skipped for sync requests and non-HTTP | 173 // We assume that ServiceWorker is skipped for sync requests and non-HTTP |
169 // familiy requests by content/ code. | 174 // familiy requests by content/ code. |
170 if (m_async && !request.skipServiceWorker() && request.url().protocolIsInHTT PFamily() && m_document.fetcher()->isControlledByServiceWorker()) { | 175 if (m_async && !request.skipServiceWorker() && request.url().protocolIsInHTT PFamily() && m_document.fetcher()->isControlledByServiceWorker()) { |
171 ResourceRequest newRequest(request); | 176 ResourceRequest newRequest(request); |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
751 return DoNotAllowStoredCredentials; | 756 return DoNotAllowStoredCredentials; |
752 return m_resourceLoaderOptions.allowCredentials; | 757 return m_resourceLoaderOptions.allowCredentials; |
753 } | 758 } |
754 | 759 |
755 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const | 760 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const |
756 { | 761 { |
757 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin (); | 762 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin (); |
758 } | 763 } |
759 | 764 |
760 } // namespace blink | 765 } // namespace blink |
OLD | NEW |