| 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_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/common/resource_type.h" | 11 #include "content/public/common/resource_type.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class RequestPeer; | 17 class RequestPeer; |
| 18 | 18 |
| 19 // Interface that allows observing request events and optionally replacing | 19 // Interface that allows observing request events and optionally replacing |
| 20 // the peer. Note that if it doesn't replace the peer it must return the | 20 // the peer. Note that if it doesn't replace the peer it must return the |
| 21 // current peer so that the ownership is continued to be held by | 21 // current peer so that the ownership is continued to be held by |
| 22 // ResourceDispatcher. | 22 // ResourceDispatcher. |
| 23 class CONTENT_EXPORT ResourceDispatcherDelegate { | 23 class CONTENT_EXPORT ResourceDispatcherDelegate { |
| 24 public: | 24 public: |
| 25 virtual ~ResourceDispatcherDelegate() {} | 25 virtual ~ResourceDispatcherDelegate() {} |
| 26 | 26 |
| 27 virtual scoped_ptr<RequestPeer> OnRequestComplete( | 27 virtual std::unique_ptr<RequestPeer> OnRequestComplete( |
| 28 scoped_ptr<RequestPeer> current_peer, | 28 std::unique_ptr<RequestPeer> current_peer, |
| 29 ResourceType resource_type, | 29 ResourceType resource_type, |
| 30 int error_code) = 0; | 30 int error_code) = 0; |
| 31 | 31 |
| 32 virtual scoped_ptr<RequestPeer> OnReceivedResponse( | 32 virtual std::unique_ptr<RequestPeer> OnReceivedResponse( |
| 33 scoped_ptr<RequestPeer> current_peer, | 33 std::unique_ptr<RequestPeer> current_peer, |
| 34 const std::string& mime_type, | 34 const std::string& mime_type, |
| 35 const GURL& url) = 0; | 35 const GURL& url) = 0; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace content | 38 } // namespace content |
| 39 | 39 |
| 40 #endif // CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ | 40 #endif // CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ |
| OLD | NEW |