| 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" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 | 12 |
| 13 namespace base { |
| 13 class MessageLoop; | 14 class MessageLoop; |
| 14 | |
| 15 namespace base { | |
| 16 class RefCountedMemory; | 15 class RefCountedMemory; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace net { | 18 namespace net { |
| 20 class URLRequest; | 19 class URLRequest; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace content { | 22 namespace content { |
| 24 class BrowserContext; | 23 class BrowserContext; |
| 25 | 24 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // The following methods are all called on the IO thread. | 58 // The following methods are all called on the IO thread. |
| 60 | 59 |
| 61 // Returns the MessageLoop on which the delegate wishes to have | 60 // Returns the MessageLoop on which the delegate wishes to have |
| 62 // StartDataRequest called to handle the request for |path|. The default | 61 // StartDataRequest called to handle the request for |path|. The default |
| 63 // implementation returns BrowserThread::UI. If the delegate does not care | 62 // implementation returns BrowserThread::UI. If the delegate does not care |
| 64 // which thread StartDataRequest is called on, this should return NULL. It may | 63 // which thread StartDataRequest is called on, this should return NULL. It may |
| 65 // be beneficial to return NULL for requests that are safe to handle directly | 64 // be beneficial to return NULL for requests that are safe to handle directly |
| 66 // on the IO thread. This can improve performance by satisfying such requests | 65 // on the IO thread. This can improve performance by satisfying such requests |
| 67 // more rapidly when there is a large amount of UI thread contention. Or the | 66 // more rapidly when there is a large amount of UI thread contention. Or the |
| 68 // delegate can return a specific thread's Messageloop if they wish. | 67 // delegate can return a specific thread's Messageloop if they wish. |
| 69 virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const; | 68 virtual base::MessageLoop* MessageLoopForRequestPath( |
| 69 const std::string& path) const; |
| 70 | 70 |
| 71 // Returns true if the URLDataSource should replace an existing URLDataSource | 71 // Returns true if the URLDataSource should replace an existing URLDataSource |
| 72 // with the same name that has already been registered. The default is true. | 72 // with the same name that has already been registered. The default is true. |
| 73 // | 73 // |
| 74 // WARNING: this is invoked on the IO thread. | 74 // WARNING: this is invoked on the IO thread. |
| 75 // | 75 // |
| 76 // TODO: nuke this and convert all callers to not replace. | 76 // TODO: nuke this and convert all callers to not replace. |
| 77 virtual bool ShouldReplaceExistingSource() const; | 77 virtual bool ShouldReplaceExistingSource() const; |
| 78 | 78 |
| 79 // Returns true if responses from this URLDataSource can be cached. | 79 // Returns true if responses from this URLDataSource can be cached. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 104 // Override in specific WebUI data sources to enable for additional schemes or | 104 // Override in specific WebUI data sources to enable for additional schemes or |
| 105 // to implement fancier access control. Typically used in concert with | 105 // to implement fancier access control. Typically used in concert with |
| 106 // ContentBrowserClient::GetAdditionalWebUISchemes() to permit additional | 106 // ContentBrowserClient::GetAdditionalWebUISchemes() to permit additional |
| 107 // WebUI scheme support for an embedder. | 107 // WebUI scheme support for an embedder. |
| 108 virtual bool ShouldServiceRequest(const net::URLRequest* request) const; | 108 virtual bool ShouldServiceRequest(const net::URLRequest* request) const; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace content | 111 } // namespace content |
| 112 | 112 |
| 113 #endif // CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ | 113 #endif // CONTENT_PUBLIC_BROWSER_URL_DATA_SOURCE_H_ |
| OLD | NEW |