| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 Result endRead(size_t) override { | 87 Result endRead(size_t) override { |
| 88 return WebDataConsumerHandle::UnexpectedError; | 88 return WebDataConsumerHandle::UnexpectedError; |
| 89 } | 89 } |
| 90 void notify(WebDataConsumerHandle::Client* client) { | 90 void notify(WebDataConsumerHandle::Client* client) { |
| 91 client->didGetReadable(); | 91 client->didGetReadable(); |
| 92 } | 92 } |
| 93 WeakPtrFactory<EmptyDataReader> m_factory; | 93 WeakPtrFactory<EmptyDataReader> m_factory; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 std::unique_ptr<Reader> obtainReader(Client* client) override { | 96 std::unique_ptr<Reader> obtainReader(Client* client) override { |
| 97 return WTF::wrapUnique(new EmptyDataReader(client)); | 97 return makeUnique<EmptyDataReader>(client); |
| 98 } | 98 } |
| 99 const char* debugName() const override { return "EmptyDataHandle"; } | 99 const char* debugName() const override { return "EmptyDataHandle"; } |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 // No-CORS requests are allowed for all these contexts, and plugin contexts with | 102 // No-CORS requests are allowed for all these contexts, and plugin contexts with |
| 103 // private permission when we set skipServiceWorker flag in PepperURLLoaderHost. | 103 // private permission when we set skipServiceWorker flag in PepperURLLoaderHost. |
| 104 bool IsNoCORSAllowedContext( | 104 bool IsNoCORSAllowedContext( |
| 105 WebURLRequest::RequestContext context, | 105 WebURLRequest::RequestContext context, |
| 106 WebURLRequest::SkipServiceWorker skipServiceWorker) { | 106 WebURLRequest::SkipServiceWorker skipServiceWorker) { |
| 107 switch (context) { | 107 switch (context) { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 // We use |m_redirectMode| to check the original redirect mode. |request| is | 520 // We use |m_redirectMode| to check the original redirect mode. |request| is |
| 521 // a new request for redirect. So we don't set the redirect mode of it in | 521 // a new request for redirect. So we don't set the redirect mode of it in |
| 522 // WebURLLoaderImpl::Context::OnReceivedRedirect(). | 522 // WebURLLoaderImpl::Context::OnReceivedRedirect(). |
| 523 DCHECK(request.useStreamOnResponse()); | 523 DCHECK(request.useStreamOnResponse()); |
| 524 // There is no need to read the body of redirect response because there is | 524 // There is no need to read the body of redirect response because there is |
| 525 // no way to read the body of opaque-redirect filtered response's internal | 525 // no way to read the body of opaque-redirect filtered response's internal |
| 526 // response. | 526 // response. |
| 527 // TODO(horo): If we support any API which expose the internal body, we will | 527 // TODO(horo): If we support any API which expose the internal body, we will |
| 528 // have to read the body. And also HTTPCache changes will be needed because | 528 // have to read the body. And also HTTPCache changes will be needed because |
| 529 // it doesn't store the body of redirect responses. | 529 // it doesn't store the body of redirect responses. |
| 530 responseReceived(resource, redirectResponse, | 530 responseReceived(resource, redirectResponse, makeUnique<EmptyDataHandle>()); |
| 531 wrapUnique(new EmptyDataHandle())); | |
| 532 | 531 |
| 533 if (m_client) { | 532 if (m_client) { |
| 534 DCHECK(m_actualRequest.isNull()); | 533 DCHECK(m_actualRequest.isNull()); |
| 535 notifyFinished(resource); | 534 notifyFinished(resource); |
| 536 } | 535 } |
| 537 | 536 |
| 538 return false; | 537 return false; |
| 539 } | 538 } |
| 540 | 539 |
| 541 if (m_redirectMode == WebURLRequest::FetchRedirectModeError) { | 540 if (m_redirectMode == WebURLRequest::FetchRedirectModeError) { |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 } | 1135 } |
| 1137 | 1136 |
| 1138 DEFINE_TRACE(DocumentThreadableLoader) { | 1137 DEFINE_TRACE(DocumentThreadableLoader) { |
| 1139 visitor->trace(m_resource); | 1138 visitor->trace(m_resource); |
| 1140 visitor->trace(m_document); | 1139 visitor->trace(m_document); |
| 1141 ThreadableLoader::trace(visitor); | 1140 ThreadableLoader::trace(visitor); |
| 1142 RawResourceClient::trace(visitor); | 1141 RawResourceClient::trace(visitor); |
| 1143 } | 1142 } |
| 1144 | 1143 |
| 1145 } // namespace blink | 1144 } // namespace blink |
| OLD | NEW |