resource_dispatcher_delegate.h revision 5f1c94371a64b3196d4be9466099bb892df9b88e
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 3// found in the LICENSE file. 4 5#ifndef CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ 6#define CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ 7 8#include <string> 9 10#include "content/common/content_export.h" 11#include "content/public/common/resource_type.h" 12 13class GURL; 14 15namespace content { 16 17class RequestPeer; 18 19// Interface that allows observing request events and optionally replacing the 20// peer. 21class CONTENT_EXPORT ResourceDispatcherDelegate { 22 public: 23 virtual ~ResourceDispatcherDelegate() {} 24 25 virtual RequestPeer* OnRequestComplete(RequestPeer* current_peer, 26 ResourceType resource_type, 27 int error_code) = 0; 28 29 virtual RequestPeer* OnReceivedResponse(RequestPeer* current_peer, 30 const std::string& mime_type, 31 const GURL& url) = 0; 32}; 33 34} // namespace content 35 36#endif // CONTENT_PUBLIC_CHILD_RESOURCE_DISPATCHER_DELEGATE_H_ 37