| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 DocumentLoader::DocumentLoader(LocalFrame* frame, const ResourceRequest& req, co
nst SubstituteData& substituteData) | 85 DocumentLoader::DocumentLoader(LocalFrame* frame, const ResourceRequest& req, co
nst SubstituteData& substituteData) |
| 86 : m_frame(frame) | 86 : m_frame(frame) |
| 87 , m_fetcher(FrameFetchContext::createContextAndFetcher(this)) | 87 , m_fetcher(FrameFetchContext::createContextAndFetcher(this)) |
| 88 , m_originalRequest(req) | 88 , m_originalRequest(req) |
| 89 , m_substituteData(substituteData) | 89 , m_substituteData(substituteData) |
| 90 , m_request(req) | 90 , m_request(req) |
| 91 , m_isClientRedirect(false) | 91 , m_isClientRedirect(false) |
| 92 , m_replacesCurrentHistoryItem(false) | 92 , m_replacesCurrentHistoryItem(false) |
| 93 , m_navigationType(NavigationTypeOther) | 93 , m_navigationType(NavigationTypeOther) |
| 94 #if !ENABLE(OILPAN) | 94 , m_documentLoadTiming(this) |
| 95 , m_weakFactory(this) | |
| 96 #endif | |
| 97 , m_documentLoadTiming(this->weakReference()) | |
| 98 , m_timeOfLastDataReceived(0.0) | 95 , m_timeOfLastDataReceived(0.0) |
| 99 , m_applicationCacheHost(ApplicationCacheHost::create(this)) | 96 , m_applicationCacheHost(ApplicationCacheHost::create(this)) |
| 100 , m_state(NotStarted) | 97 , m_state(NotStarted) |
| 101 , m_inDataReceived(false) | 98 , m_inDataReceived(false) |
| 102 , m_dataBuffer(SharedBuffer::create()) | 99 , m_dataBuffer(SharedBuffer::create()) |
| 103 { | 100 { |
| 104 } | 101 } |
| 105 | 102 |
| 106 FrameLoader* DocumentLoader::frameLoader() const | 103 FrameLoader* DocumentLoader::frameLoader() const |
| 107 { | 104 { |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 if (!canShowMIMEType(m_response.mimeType(), m_frame->page())) | 433 if (!canShowMIMEType(m_response.mimeType(), m_frame->page())) |
| 437 return false; | 434 return false; |
| 438 | 435 |
| 439 // Prevent remote web archives from loading because they can claim to be fro
m any domain and thus avoid cross-domain security checks. | 436 // Prevent remote web archives from loading because they can claim to be fro
m any domain and thus avoid cross-domain security checks. |
| 440 if (isArchiveMIMEType(m_response.mimeType()) && !SchemeRegistry::shouldTreat
URLSchemeAsLocal(m_request.url().protocol())) | 437 if (isArchiveMIMEType(m_response.mimeType()) && !SchemeRegistry::shouldTreat
URLSchemeAsLocal(m_request.url().protocol())) |
| 441 return false; | 438 return false; |
| 442 | 439 |
| 443 return true; | 440 return true; |
| 444 } | 441 } |
| 445 | 442 |
| 446 WeakPtrWillBeRawPtr<DocumentLoader> DocumentLoader::weakReference() | |
| 447 { | |
| 448 #if ENABLE(OILPAN) | |
| 449 return this; | |
| 450 #else | |
| 451 return m_weakFactory.createWeakPtr(); | |
| 452 #endif | |
| 453 } | |
| 454 | |
| 455 void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo
nse& response) | 443 void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo
nse& response) |
| 456 { | 444 { |
| 457 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, ma
inResourceIdentifier(), response); | 445 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, ma
inResourceIdentifier(), response); |
| 458 | 446 |
| 459 frame()->document()->enforceSandboxFlags(SandboxOrigin); | 447 frame()->document()->enforceSandboxFlags(SandboxOrigin); |
| 460 if (FrameOwner* owner = frame()->owner()) | 448 if (FrameOwner* owner = frame()->owner()) |
| 461 owner->dispatchLoad(); | 449 owner->dispatchLoad(); |
| 462 | 450 |
| 463 // The load event might have detached this frame. In that case, the load wil
l already have been cancelled during detach. | 451 // The load event might have detached this frame. In that case, the load wil
l already have been cancelled during detach. |
| 464 if (frameLoader()) | 452 if (frameLoader()) |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 { | 862 { |
| 875 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 863 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
| 876 if (!source.isNull()) | 864 if (!source.isNull()) |
| 877 m_writer->appendReplacingData(source); | 865 m_writer->appendReplacingData(source); |
| 878 endWriting(m_writer.get()); | 866 endWriting(m_writer.get()); |
| 879 } | 867 } |
| 880 | 868 |
| 881 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 869 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 882 | 870 |
| 883 } // namespace blink | 871 } // namespace blink |
| OLD | NEW |