Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchManager.cpp

Issue 2610653002: Tidy up XMLHttpRequest::endLoading(). (Closed)
Patch Set: alpha conversion + use it at two more call sites Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp ('k') | third_party/WebKit/Source/modules/fetch/Response.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698