| 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_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_vector.h" | |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
| 17 #include "ppapi/proxy/resource_message_params.h" | 17 #include "ppapi/proxy/resource_message_params.h" |
| 18 #include "ppapi/shared_impl/url_request_info_data.h" | 18 #include "ppapi/shared_impl/url_request_info_data.h" |
| 19 #include "ppapi/shared_impl/url_response_info_data.h" | 19 #include "ppapi/shared_impl/url_response_info_data.h" |
| 20 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderClient.h" | 20 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderClient.h" |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 class WebAssociatedURLLoader; | 23 class WebAssociatedURLLoader; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); | 69 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); |
| 70 int32_t OnHostMsgGrantUniversalAccess( | 70 int32_t OnHostMsgGrantUniversalAccess( |
| 71 ppapi::host::HostMessageContext* context); | 71 ppapi::host::HostMessageContext* context); |
| 72 | 72 |
| 73 // Sends or queues an unsolicited message to the plugin resource. This | 73 // Sends or queues an unsolicited message to the plugin resource. This |
| 74 // handles cases where messages must be reordered for the plugin and | 74 // handles cases where messages must be reordered for the plugin and |
| 75 // the case where we have created a pending host resource and the | 75 // the case where we have created a pending host resource and the |
| 76 // plugin has not connected to us yet. | 76 // plugin has not connected to us yet. |
| 77 // | 77 // |
| 78 // Takes ownership of the given pointer. | 78 // Takes ownership of the given pointer. |
| 79 void SendUpdateToPlugin(IPC::Message* msg); | 79 void SendUpdateToPlugin(std::unique_ptr<IPC::Message> msg); |
| 80 | 80 |
| 81 // Sends or queues an unsolicited message to the plugin resource. This is | 81 // Sends or queues an unsolicited message to the plugin resource. This is |
| 82 // used inside SendUpdateToPlugin for messages that are already ordered | 82 // used inside SendUpdateToPlugin for messages that are already ordered |
| 83 // properly. | 83 // properly. |
| 84 // | 84 // |
| 85 // Takes ownership of the given pointer. | 85 // Takes ownership of the given pointer. |
| 86 void SendOrderedUpdateToPlugin(IPC::Message* msg); | 86 void SendOrderedUpdateToPlugin(std::unique_ptr<IPC::Message> msg); |
| 87 | 87 |
| 88 void Close(); | 88 void Close(); |
| 89 | 89 |
| 90 // Returns the frame for the current request. | 90 // Returns the frame for the current request. |
| 91 blink::WebLocalFrame* GetFrame(); | 91 blink::WebLocalFrame* GetFrame(); |
| 92 | 92 |
| 93 // Calls SetDefersLoading on the current load. This encapsulates the logic | 93 // Calls SetDefersLoading on the current load. This encapsulates the logic |
| 94 // differences between document loads and regular ones. | 94 // differences between document loads and regular ones. |
| 95 void SetDefersLoading(bool defers_loading); | 95 void SetDefersLoading(bool defers_loading); |
| 96 | 96 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 124 std::unique_ptr<blink::WebAssociatedURLLoader> loader_; | 124 std::unique_ptr<blink::WebAssociatedURLLoader> loader_; |
| 125 | 125 |
| 126 int64_t bytes_sent_; | 126 int64_t bytes_sent_; |
| 127 int64_t total_bytes_to_be_sent_; | 127 int64_t total_bytes_to_be_sent_; |
| 128 int64_t bytes_received_; | 128 int64_t bytes_received_; |
| 129 int64_t total_bytes_to_be_received_; | 129 int64_t total_bytes_to_be_received_; |
| 130 | 130 |
| 131 // Messages sent while the resource host is pending. These will be forwarded | 131 // Messages sent while the resource host is pending. These will be forwarded |
| 132 // to the plugin when the plugin side connects. The pointers are owned by | 132 // to the plugin when the plugin side connects. The pointers are owned by |
| 133 // this object and must be deleted. | 133 // this object and must be deleted. |
| 134 ScopedVector<IPC::Message> pending_replies_; | 134 std::vector<std::unique_ptr<IPC::Message>> pending_replies_; |
| 135 ScopedVector<IPC::Message> out_of_order_replies_; | 135 std::vector<std::unique_ptr<IPC::Message>> out_of_order_replies_; |
| 136 | 136 |
| 137 // True when there's a pending DataFromURLResponse call which will send a | 137 // True when there's a pending DataFromURLResponse call which will send a |
| 138 // PpapiPluginMsg_URLLoader_ReceivedResponse to the plugin, which introduces | 138 // PpapiPluginMsg_URLLoader_ReceivedResponse to the plugin, which introduces |
| 139 // ordering constraints on following messages to the plugin. | 139 // ordering constraints on following messages to the plugin. |
| 140 bool pending_response_; | 140 bool pending_response_; |
| 141 | 141 |
| 142 base::WeakPtrFactory<PepperURLLoaderHost> weak_factory_; | 142 base::WeakPtrFactory<PepperURLLoaderHost> weak_factory_; |
| 143 | 143 |
| 144 DISALLOW_COPY_AND_ASSIGN(PepperURLLoaderHost); | 144 DISALLOW_COPY_AND_ASSIGN(PepperURLLoaderHost); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 } // namespace content | 147 } // namespace content |
| 148 | 148 |
| 149 #endif // CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ | 149 #endif // CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ |
| OLD | NEW |