| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Used to complete an asynchronous resource request in response to resource | 27 // Used to complete an asynchronous resource request in response to resource |
| 28 // load events from the resource dispatcher host. | 28 // load events from the resource dispatcher host. |
| 29 class AsyncResourceHandler : public ResourceHandler, | 29 class AsyncResourceHandler : public ResourceHandler, |
| 30 public ResourceMessageDelegate { | 30 public ResourceMessageDelegate { |
| 31 public: | 31 public: |
| 32 AsyncResourceHandler(net::URLRequest* request, | 32 AsyncResourceHandler(net::URLRequest* request, |
| 33 ResourceDispatcherHostImpl* rdh); | 33 ResourceDispatcherHostImpl* rdh); |
| 34 virtual ~AsyncResourceHandler(); | 34 virtual ~AsyncResourceHandler(); |
| 35 | 35 |
| 36 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 36 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 37 | 37 |
| 38 // ResourceHandler implementation: | 38 // ResourceHandler implementation: |
| 39 virtual bool OnUploadProgress(uint64 position, uint64 size) OVERRIDE; | 39 virtual bool OnUploadProgress(uint64 position, uint64 size) override; |
| 40 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 40 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
| 41 ResourceResponse* response, | 41 ResourceResponse* response, |
| 42 bool* defer) OVERRIDE; | 42 bool* defer) override; |
| 43 virtual bool OnResponseStarted(ResourceResponse* response, | 43 virtual bool OnResponseStarted(ResourceResponse* response, |
| 44 bool* defer) OVERRIDE; | 44 bool* defer) override; |
| 45 virtual bool OnWillStart(const GURL& url, bool* defer) OVERRIDE; | 45 virtual bool OnWillStart(const GURL& url, bool* defer) override; |
| 46 virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) OVERRIDE; | 46 virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; |
| 47 virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 47 virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 48 int* buf_size, | 48 int* buf_size, |
| 49 int min_size) OVERRIDE; | 49 int min_size) override; |
| 50 virtual bool OnReadCompleted(int bytes_read, bool* defer) OVERRIDE; | 50 virtual bool OnReadCompleted(int bytes_read, bool* defer) override; |
| 51 virtual void OnResponseCompleted(const net::URLRequestStatus& status, | 51 virtual void OnResponseCompleted(const net::URLRequestStatus& status, |
| 52 const std::string& security_info, | 52 const std::string& security_info, |
| 53 bool* defer) OVERRIDE; | 53 bool* defer) override; |
| 54 virtual void OnDataDownloaded(int bytes_downloaded) OVERRIDE; | 54 virtual void OnDataDownloaded(int bytes_downloaded) override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // IPC message handlers: | 57 // IPC message handlers: |
| 58 void OnFollowRedirect(int request_id); | 58 void OnFollowRedirect(int request_id); |
| 59 void OnDataReceivedACK(int request_id); | 59 void OnDataReceivedACK(int request_id); |
| 60 | 60 |
| 61 bool EnsureResourceBufferIsInitialized(); | 61 bool EnsureResourceBufferIsInitialized(); |
| 62 void ResumeIfDeferred(); | 62 void ResumeIfDeferred(); |
| 63 void OnDefer(); | 63 void OnDefer(); |
| 64 | 64 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 80 int64_t reported_transfer_size_; | 80 int64_t reported_transfer_size_; |
| 81 | 81 |
| 82 base::TimeTicks redirect_start_time_; | 82 base::TimeTicks redirect_start_time_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); | 84 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace content | 87 } // namespace content |
| 88 | 88 |
| 89 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 89 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
| OLD | NEW |