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/FetchManager.h" | 5 #include "modules/fetch/FetchManager.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/V8ThrowException.h" | 10 #include "bindings/core/v8/V8ThrowException.h" |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } | 549 } |
550 return nullptr; | 550 return nullptr; |
551 } | 551 } |
552 | 552 |
553 void FetchManager::Loader::loadSucceeded() { | 553 void FetchManager::Loader::loadSucceeded() { |
554 ASSERT(!m_failed); | 554 ASSERT(!m_failed); |
555 | 555 |
556 m_finished = true; | 556 m_finished = true; |
557 | 557 |
558 if (document() && document()->frame() && document()->frame()->page() && | 558 if (document() && document()->frame() && document()->frame()->page() && |
559 m_responseHttpStatusCode >= 200 && m_responseHttpStatusCode < 300) { | 559 FetchUtils::isOkStatus(m_responseHttpStatusCode)) { |
560 document()->frame()->page()->chromeClient().ajaxSucceeded( | 560 document()->frame()->page()->chromeClient().ajaxSucceeded( |
561 document()->frame()); | 561 document()->frame()); |
562 } | 562 } |
563 InspectorInstrumentation::didFinishFetch(m_executionContext, this, | 563 InspectorInstrumentation::didFinishFetch(m_executionContext, this, |
564 m_request->method(), | 564 m_request->method(), |
565 m_request->url().getString()); | 565 m_request->url().getString()); |
566 notifyFinished(); | 566 notifyFinished(); |
567 } | 567 } |
568 | 568 |
569 void FetchManager::Loader::start() { | 569 void FetchManager::Loader::start() { |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 m_loaders.remove(loader); | 931 m_loaders.remove(loader); |
932 loader->dispose(); | 932 loader->dispose(); |
933 } | 933 } |
934 | 934 |
935 DEFINE_TRACE(FetchManager) { | 935 DEFINE_TRACE(FetchManager) { |
936 visitor->trace(m_loaders); | 936 visitor->trace(m_loaders); |
937 ContextLifecycleObserver::trace(visitor); | 937 ContextLifecycleObserver::trace(visitor); |
938 } | 938 } |
939 | 939 |
940 } // namespace blink | 940 } // namespace blink |
OLD | NEW |