Chromium Code Reviews| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 | 408 |
| 409 // For users on slow connections, we want to avoid blocking the parser in | 409 // For users on slow connections, we want to avoid blocking the parser in |
| 410 // the main frame on script loads inserted via document.write, since it can | 410 // the main frame on script loads inserted via document.write, since it can |
| 411 // add significant delays before page content is displayed on the screen. | 411 // add significant delays before page content is displayed on the screen. |
| 412 // TODO(toyoshim): Move following logic that rewrites ResourceRequest to | 412 // TODO(toyoshim): Move following logic that rewrites ResourceRequest to |
| 413 // somewhere that should be relevant to the script resource handling. | 413 // somewhere that should be relevant to the script resource handling. |
| 414 if (type == Resource::Script && isMainFrame() && m_document && | 414 if (type == Resource::Script && isMainFrame() && m_document && |
| 415 shouldDisallowFetchForMainFrameScript(request, defer, *m_document)) | 415 shouldDisallowFetchForMainFrameScript(request, defer, *m_document)) |
| 416 return WebCachePolicy::ReturnCacheDataDontLoad; | 416 return WebCachePolicy::ReturnCacheDataDontLoad; |
| 417 | 417 |
| 418 // TODO(toyoshim): We should check isConditional() and use ValidatingCacheData | 418 const WebCachePolicy cachePolicy = |
| 419 // only when |cachePolicy| below is UseProtocolCachePolicy. | 419 determineFrameWebCachePolicy(frame(), ResourceType::kIsNotMainResource); |
| 420 if (request.isConditional()) | 420 |
| 421 if (cachePolicy == WebCachePolicy::UseProtocolCachePolicy && | |
| 422 request.isConditional()) { | |
|
Nate Chapin
2017/03/28 21:45:54
Hmm...one other thought. Can this clause be merged
Takashi Toyoshima
2017/03/29 10:56:17
Currently, determineWCP requires many parameters t
| |
| 421 return WebCachePolicy::ValidatingCacheData; | 423 return WebCachePolicy::ValidatingCacheData; |
| 422 | 424 } |
| 423 return determineFrameWebCachePolicy(frame(), | 425 return cachePolicy; |
| 424 ResourceType::kIsNotMainResource); | |
| 425 } | 426 } |
| 426 | 427 |
| 427 // The |m_documentLoader| is null in the FrameFetchContext of an imported | 428 // The |m_documentLoader| is null in the FrameFetchContext of an imported |
| 428 // document. | 429 // document. |
| 429 // FIXME(http://crbug.com/274173): This means Inspector, which uses | 430 // FIXME(http://crbug.com/274173): This means Inspector, which uses |
| 430 // DocumentLoader as a grouping entity, cannot see imported documents. | 431 // DocumentLoader as a grouping entity, cannot see imported documents. |
| 431 inline DocumentLoader* FrameFetchContext::masterDocumentLoader() const { | 432 inline DocumentLoader* FrameFetchContext::masterDocumentLoader() const { |
| 432 if (m_documentLoader) | 433 if (m_documentLoader) |
| 433 return m_documentLoader.get(); | 434 return m_documentLoader.get(); |
| 434 | 435 |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1080 response); | 1081 response); |
| 1081 } | 1082 } |
| 1082 | 1083 |
| 1083 DEFINE_TRACE(FrameFetchContext) { | 1084 DEFINE_TRACE(FrameFetchContext) { |
| 1084 visitor->trace(m_document); | 1085 visitor->trace(m_document); |
| 1085 visitor->trace(m_documentLoader); | 1086 visitor->trace(m_documentLoader); |
| 1086 FetchContext::trace(visitor); | 1087 FetchContext::trace(visitor); |
| 1087 } | 1088 } |
| 1088 | 1089 |
| 1089 } // namespace blink | 1090 } // namespace blink |
| OLD | NEW |