Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_URL_DATA_SOURCE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 // WebUI scheme support for an embedder. | 112 // WebUI scheme support for an embedder. |
| 113 virtual bool ShouldServiceRequest(const net::URLRequest* request) const; | 113 virtual bool ShouldServiceRequest(const net::URLRequest* request) const; |
| 114 | 114 |
| 115 // By default, Content-Type: header is not sent along with the response. | 115 // By default, Content-Type: header is not sent along with the response. |
| 116 // To start sending mime type returned by GetMimeType in HTTP headers, | 116 // To start sending mime type returned by GetMimeType in HTTP headers, |
| 117 // return true. It is useful when tunneling response served from this data | 117 // return true. It is useful when tunneling response served from this data |
| 118 // source programmatically. Or when AppCache is enabled for this source as it | 118 // source programmatically. Or when AppCache is enabled for this source as it |
| 119 // is for chrome-devtools. | 119 // is for chrome-devtools. |
| 120 virtual bool ShouldServeMimeTypeAsContentTypeHeader() const; | 120 virtual bool ShouldServeMimeTypeAsContentTypeHeader() const; |
| 121 | 121 |
| 122 // This method is called when the request contains "Origin:" header. The value | |
| 123 // of the header is passed in |origin| parameter. If the returned value is not | |
| 124 // empty, it is used as a value for "Access-Control-Allow-Origin:" response | |
| 125 // header, otherwise the header is not set. This method should return either | |
| 126 // |origin|, or "*", or "none", or empty string. | |
| 127 // Default implementation returns an empty string. | |
| 128 virtual std::string GetAccessControlAllowOriginForOrigin( | |
|
Charlie Reis
2014/10/06 19:43:20
This looks like it is only used within content/, s
dzhioev (left Google)
2014/10/08 18:41:38
We can't override this method in SharedResourceDat
Charlie Reis
2014/10/08 20:46:24
It would work if there were an impl class that Sha
| |
| 129 const std::string& origin) const; | |
| 130 | |
| 122 // Called to inform the source that StartDataRequest() will be called soon. | 131 // Called to inform the source that StartDataRequest() will be called soon. |
| 123 // Gives the source an opportunity to rewrite |path| to incorporate extra | 132 // Gives the source an opportunity to rewrite |path| to incorporate extra |
| 124 // information from the URLRequest prior to serving. | 133 // information from the URLRequest prior to serving. |
| 125 virtual void WillServiceRequest( | 134 virtual void WillServiceRequest( |
| 126 const net::URLRequest* request, | 135 const net::URLRequest* request, |
| 127 std::string* path) const {} | 136 std::string* path) const {} |
| 128 }; | 137 }; |
| 129 | 138 |
| 130 } // namespace content | 139 } // namespace content |
| 131 | 140 |
| 132 #endif // CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ | 141 #endif // CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ |
| OLD | NEW |