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

Unified Diff: content/renderer/fetchers/web_url_loader_client_impl.cc

Issue 2399463007: AssociatedURLLoader shouldn't derive from WebURLLoader (Closed)
Patch Set: Rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/fetchers/web_url_loader_client_impl.cc
diff --git a/content/renderer/fetchers/web_url_loader_client_impl.cc b/content/renderer/fetchers/web_url_loader_client_impl.cc
deleted file mode 100644
index 84f72f941ae4cd8004eb00c59b4daeef610a5f21..0000000000000000000000000000000000000000
--- a/content/renderer/fetchers/web_url_loader_client_impl.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/fetchers/web_url_loader_client_impl.h"
-
-#include "base/logging.h"
-#include "third_party/WebKit/public/platform/WebURLError.h"
-#include "third_party/WebKit/public/platform/WebURLLoader.h"
-#include "third_party/WebKit/public/platform/WebURLResponse.h"
-
-namespace content {
-
-WebURLLoaderClientImpl::WebURLLoaderClientImpl()
- : completed_(false)
- , status_(LOADING) {
-}
-
-WebURLLoaderClientImpl::~WebURLLoaderClientImpl() {
-}
-
-void WebURLLoaderClientImpl::didReceiveResponse(
- blink::WebURLLoader* loader, const blink::WebURLResponse& response) {
- DCHECK(!completed_);
- response_ = response;
-}
-
-void WebURLLoaderClientImpl::didReceiveData(blink::WebURLLoader* loader,
- const char* data,
- int data_length,
- int encoded_data_length,
- int encoded_body_length) {
- // The AssociatedURLLoader will continue after a load failure.
- // For example, for an Access Control error.
- if (completed_)
- return;
- DCHECK(data_length > 0);
-
- data_.append(data, data_length);
-}
-
-void WebURLLoaderClientImpl::didReceiveCachedMetadata(
- blink::WebURLLoader* loader,
- const char* data,
- int data_length) {
- DCHECK(!completed_);
- DCHECK(data_length > 0);
-
- metadata_.assign(data, data_length);
-}
-
-void WebURLLoaderClientImpl::didFinishLoading(
- blink::WebURLLoader* loader,
- double finishTime,
- int64_t total_encoded_data_length) {
- // The AssociatedURLLoader will continue after a load failure.
- // For example, for an Access Control error.
- if (completed_)
- return;
- OnLoadCompleteInternal(LOAD_SUCCEEDED);
-}
-
-void WebURLLoaderClientImpl::didFail(blink::WebURLLoader* loader,
- const blink::WebURLError& error) {
- OnLoadCompleteInternal(LOAD_FAILED);
-}
-
-void WebURLLoaderClientImpl::Cancel() {
- OnLoadCompleteInternal(LOAD_FAILED);
-}
-
-void WebURLLoaderClientImpl::OnLoadCompleteInternal(LoadStatus status) {
- DCHECK(!completed_);
- DCHECK(status_ == LOADING);
-
- completed_ = true;
- status_ = status;
-
- OnLoadComplete();
-}
-
-} // namespace content
« no previous file with comments | « content/renderer/fetchers/web_url_loader_client_impl.h ('k') | content/renderer/media/android/media_info_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698