Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: content/public/browser/resource_dispatcher_host_delegate.h

Issue 953793003: Ensuring interception of stream get determined by plugin path before checking mime type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/files/file_path.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
13 #include "content/public/common/resource_type.h" 14 #include "content/public/common/resource_type.h"
14 15
15 class GURL; 16 class GURL;
16 template <class T> class ScopedVector; 17 template <class T> class ScopedVector;
17 18
18 namespace IPC { 19 namespace IPC {
19 class Sender; 20 class Sender;
20 } 21 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // resource. 86 // resource.
86 // If true is returned, a new Stream will be created and OnStreamCreated() 87 // If true is returned, a new Stream will be created and OnStreamCreated()
87 // will be called with 88 // will be called with
88 // - a StreamHandle instance for the Stream. The handle contains the URL for 89 // - a StreamHandle instance for the Stream. The handle contains the URL for
89 // reading the Stream etc. 90 // reading the Stream etc.
90 // The Stream's origin will be set to |origin|. 91 // The Stream's origin will be set to |origin|.
91 // 92 //
92 // If the stream will be rendered in a BrowserPlugin, |payload| will contain 93 // If the stream will be rendered in a BrowserPlugin, |payload| will contain
93 // the data that should be given to the old ResourceHandler to forward to the 94 // the data that should be given to the old ResourceHandler to forward to the
94 // renderer process. 95 // renderer process.
95 virtual bool ShouldInterceptResourceAsStream(net::URLRequest* request, 96 virtual bool ShouldInterceptResourceAsStream(
96 const std::string& mime_type, 97 net::URLRequest* request,
97 GURL* origin, 98 const base::FilePath& plugin_path,
98 std::string* payload); 99 const std::string& mime_type,
100 GURL* origin,
101 std::string* payload);
99 102
100 // Informs the delegate that a Stream was created. The Stream can be read from 103 // Informs the delegate that a Stream was created. The Stream can be read from
101 // the blob URL of the Stream, but can only be read once. 104 // the blob URL of the Stream, but can only be read once.
102 virtual void OnStreamCreated(net::URLRequest* request, 105 virtual void OnStreamCreated(net::URLRequest* request,
103 scoped_ptr<content::StreamInfo> stream); 106 scoped_ptr<content::StreamInfo> stream);
104 107
105 // Informs the delegate that a response has started. 108 // Informs the delegate that a response has started.
106 virtual void OnResponseStarted(net::URLRequest* request, 109 virtual void OnResponseStarted(net::URLRequest* request,
107 ResourceContext* resource_context, 110 ResourceContext* resource_context,
108 ResourceResponse* response, 111 ResourceResponse* response,
109 IPC::Sender* sender); 112 IPC::Sender* sender);
110 113
111 // Informs the delegate that a request has been redirected. 114 // Informs the delegate that a request has been redirected.
112 virtual void OnRequestRedirected(const GURL& redirect_url, 115 virtual void OnRequestRedirected(const GURL& redirect_url,
113 net::URLRequest* request, 116 net::URLRequest* request,
114 ResourceContext* resource_context, 117 ResourceContext* resource_context,
115 ResourceResponse* response); 118 ResourceResponse* response);
116 119
117 // Notification that a request has completed. 120 // Notification that a request has completed.
118 virtual void RequestComplete(net::URLRequest* url_request); 121 virtual void RequestComplete(net::URLRequest* url_request);
119 122
120 protected: 123 protected:
121 ResourceDispatcherHostDelegate(); 124 ResourceDispatcherHostDelegate();
122 virtual ~ResourceDispatcherHostDelegate(); 125 virtual ~ResourceDispatcherHostDelegate();
123 }; 126 };
124 127
125 } // namespace content 128 } // namespace content
126 129
127 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ 130 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/public/browser/resource_dispatcher_host_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698