| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/fetch/Request.h" | 5 #include "modules/fetch/Request.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "bindings/core/v8/V8PrivateProperty.h" |
| 8 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 9 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| 10 #include "core/loader/ThreadableLoader.h" | 11 #include "core/loader/ThreadableLoader.h" |
| 11 #include "modules/fetch/BodyStreamBuffer.h" | 12 #include "modules/fetch/BodyStreamBuffer.h" |
| 12 #include "modules/fetch/FetchManager.h" | 13 #include "modules/fetch/FetchManager.h" |
| 13 #include "modules/fetch/RequestInit.h" | 14 #include "modules/fetch/RequestInit.h" |
| 14 #include "platform/HTTPNames.h" | 15 #include "platform/HTTPNames.h" |
| 15 #include "platform/RuntimeEnabledFeatures.h" | 16 #include "platform/RuntimeEnabledFeatures.h" |
| 16 #include "platform/loader/fetch/FetchUtils.h" | 17 #include "platform/loader/fetch/FetchUtils.h" |
| 17 #include "platform/loader/fetch/ResourceLoaderOptions.h" | 18 #include "platform/loader/fetch/ResourceLoaderOptions.h" |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 v8::Local<v8::Value> bodyBuffer = ToV8(this->bodyBuffer(), scriptState); | 722 v8::Local<v8::Value> bodyBuffer = ToV8(this->bodyBuffer(), scriptState); |
| 722 v8::Local<v8::Value> request = ToV8(this, scriptState); | 723 v8::Local<v8::Value> request = ToV8(this, scriptState); |
| 723 if (request.IsEmpty()) { | 724 if (request.IsEmpty()) { |
| 724 // |toV8| can return an empty handle when the worker is terminating. | 725 // |toV8| can return an empty handle when the worker is terminating. |
| 725 // We don't want the renderer to crash in such cases. | 726 // We don't want the renderer to crash in such cases. |
| 726 // TODO(yhirano): Delete this block after the graceful shutdown | 727 // TODO(yhirano): Delete this block after the graceful shutdown |
| 727 // mechanism is introduced. | 728 // mechanism is introduced. |
| 728 return; | 729 return; |
| 729 } | 730 } |
| 730 DCHECK(request->IsObject()); | 731 DCHECK(request->IsObject()); |
| 731 V8HiddenValue::setHiddenValue( | 732 V8PrivateProperty::getInternalBodyBuffer(scriptState->isolate()) |
| 732 scriptState, request.As<v8::Object>(), | 733 .set(request.As<v8::Object>(), bodyBuffer); |
| 733 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer); | |
| 734 } | 734 } |
| 735 | 735 |
| 736 DEFINE_TRACE(Request) { | 736 DEFINE_TRACE(Request) { |
| 737 Body::trace(visitor); | 737 Body::trace(visitor); |
| 738 visitor->trace(m_request); | 738 visitor->trace(m_request); |
| 739 visitor->trace(m_headers); | 739 visitor->trace(m_headers); |
| 740 } | 740 } |
| 741 | 741 |
| 742 } // namespace blink | 742 } // namespace blink |
| OLD | NEW |