Home | History | Annotate | Download | only in browser
      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 ANDROID_WEBVIEW_BROWSER_INTERCEPTED_REQUEST_DATA_H_
      6 #define ANDROID_WEBVIEW_BROWSER_INTERCEPTED_REQUEST_DATA_H_
      7 
      8 #include <string>
      9 
     10 #include "base/memory/scoped_ptr.h"
     11 
     12 namespace net {
     13 class URLRequest;
     14 class URLRequestJob;
     15 class NetworkDelegate;
     16 }
     17 
     18 namespace android_webview {
     19 
     20 // This class represents the Java-side data that is to be used to complete a
     21 // particular URLRequest.
     22 class InterceptedRequestData {
     23  public:
     24   virtual ~InterceptedRequestData() {}
     25 
     26   // This creates a URLRequestJob for the |request| wich will read data from
     27   // the |intercepted_request_data| structure (instead of going to the network
     28   // or to the cache).
     29   // The newly created job does not take ownership of |this|.
     30   virtual net::URLRequestJob* CreateJobFor(
     31       net::URLRequest* request,
     32       net::NetworkDelegate* network_delegate) const = 0;
     33 
     34  protected:
     35   InterceptedRequestData() {}
     36 
     37  private:
     38   DISALLOW_COPY_AND_ASSIGN(InterceptedRequestData);
     39 };
     40 
     41 } // namespace android_webview
     42 
     43 #endif  // ANDROID_WEBVIEW_BROWSER_INTERCEPTED_REQUEST_DATA_H_
     44