| Index: content/browser/loader/detached_resource_handler.h
|
| diff --git a/content/browser/loader/detached_resource_handler.h b/content/browser/loader/detached_resource_handler.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..841889a7f25b127b0f3ae9f98a4534b46d9062a1
|
| --- /dev/null
|
| +++ b/content/browser/loader/detached_resource_handler.h
|
| @@ -0,0 +1,69 @@
|
| +// Copyright (c) 2013 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.
|
| +
|
| +#ifndef CONTENT_BROWSER_LOADER_DETACHED_RESOURCE_HANDLER_H_
|
| +#define CONTENT_BROWSER_LOADER_DETACHED_RESOURCE_HANDLER_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/memory/ref_counted.h"
|
| +#include "content/browser/loader/resource_handler.h"
|
| +#include "content/browser/loader/resource_message_delegate.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace net {
|
| +class URLRequest;
|
| +class IOBuffer;
|
| +}
|
| +
|
| +namespace content {
|
| +class ResourceDispatcherHostImpl;
|
| +
|
| +// Used to complete an asynchronous resource request in which the renderer only
|
| +// cares about load and error events, and does not want to see the bytes. The
|
| +// handler will continue if the renderer disappears.
|
| +class DetachedResourceHandler : public ResourceHandler {
|
| + public:
|
| + DetachedResourceHandler(net::URLRequest* request,
|
| + ResourceDispatcherHostImpl* rdh);
|
| +
|
| + virtual ~DetachedResourceHandler();
|
| +
|
| + // ResourceHandler implementation:
|
| + virtual bool OnUploadProgress(int request_id, uint64 position,
|
| + uint64 size) OVERRIDE;
|
| +
|
| + virtual bool OnResponseStarted(int request_id, ResourceResponse* response,
|
| + bool* defer) OVERRIDE;
|
| +
|
| + virtual bool OnWillStart(int request_id, const GURL& url,
|
| + bool* defer) OVERRIDE;
|
| +
|
| + virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
|
| + int min_size) OVERRIDE;
|
| +
|
| + virtual bool OnReadCompleted(int request_id, int bytes_read,
|
| + bool* defer) OVERRIDE;
|
| +
|
| + virtual bool OnRequestRedirected(int request_id, const GURL& new_url,
|
| + ResourceResponse* response,
|
| + bool* defer) OVERRIDE;
|
| +
|
| + virtual bool OnResponseCompleted(int request_id,
|
| + const net::URLRequestStatus& status,
|
| + const std::string& security_info) OVERRIDE;
|
| +
|
| + virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE;
|
| +
|
| + private:
|
| + net::URLRequest* request_;
|
| + ResourceDispatcherHostImpl* rdh_;
|
| + scoped_refptr<net::IOBuffer> read_buffer_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DetachedResourceHandler);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_LOADER_DETACHED_RESOURCE_HANDLER_H_
|
|
|