OLD | NEW |
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_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // ResourceController implementation: | 49 // ResourceController implementation: |
50 void Resume() override; | 50 void Resume() override; |
51 void Cancel() override; | 51 void Cancel() override; |
52 void CancelAndIgnore() override; | 52 void CancelAndIgnore() override; |
53 void CancelWithError(int error_code) override; | 53 void CancelWithError(int error_code) override; |
54 | 54 |
55 bool ProcessResponse(bool* defer); | 55 bool ProcessResponse(bool* defer); |
56 | 56 |
57 bool ShouldSniffContent(); | 57 bool ShouldSniffContent(); |
58 bool DetermineMimeType(); | 58 bool DetermineMimeType(); |
| 59 // Returns true if a plugin will handle the current request. |defer| is set |
| 60 // to true if plugin data is stale and needs to be refreshed before the |
| 61 // request can be handled. |request_handled| is false if the request should |
| 62 // be cancelled and true otherwise. |
| 63 bool IsHandledByPlugin(bool* defer, bool* request_handled); |
59 bool SelectNextHandler(bool* defer); | 64 bool SelectNextHandler(bool* defer); |
60 bool UseAlternateNextHandler(scoped_ptr<ResourceHandler> handler, | 65 bool UseAlternateNextHandler(scoped_ptr<ResourceHandler> handler, |
61 const std::string& payload_for_old_handler); | 66 const std::string& payload_for_old_handler); |
62 | 67 |
63 bool ReplayReadCompleted(bool* defer); | 68 bool ReplayReadCompleted(bool* defer); |
64 void CallReplayReadCompleted(); | 69 void CallReplayReadCompleted(); |
65 | 70 |
66 bool MustDownload(); | 71 bool MustDownload(); |
67 bool HasSupportingPlugin(bool* is_stale); | |
68 | 72 |
69 // Copies data from |read_buffer_| to |next_handler_|. | 73 // Copies data from |read_buffer_| to |next_handler_|. |
70 bool CopyReadBufferToNextHandler(); | 74 bool CopyReadBufferToNextHandler(); |
71 | 75 |
72 // Called on the IO thread once the list of plugins has been loaded. | 76 // Called on the IO thread once the list of plugins has been loaded. |
73 void OnPluginsLoaded(const std::vector<WebPluginInfo>& plugins); | 77 void OnPluginsLoaded(const std::vector<WebPluginInfo>& plugins); |
74 | 78 |
75 enum State { | 79 enum State { |
76 STATE_STARTING, | 80 STATE_STARTING, |
77 | 81 |
(...skipping 27 matching lines...) Expand all Loading... |
105 bool must_download_is_set_; | 109 bool must_download_is_set_; |
106 | 110 |
107 base::WeakPtrFactory<BufferedResourceHandler> weak_ptr_factory_; | 111 base::WeakPtrFactory<BufferedResourceHandler> weak_ptr_factory_; |
108 | 112 |
109 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); | 113 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); |
110 }; | 114 }; |
111 | 115 |
112 } // namespace content | 116 } // namespace content |
113 | 117 |
114 #endif // CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ | 118 #endif // CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ |
OLD | NEW |