| 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_CHILD_NPAPI_WEBPLUGIN_RESOURCE_CLIENT_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_RESOURCE_CLIENT_H_ |
| 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_RESOURCE_CLIENT_H_ | 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_RESOURCE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | |
| 11 | 12 |
| 12 class GURL; | 13 class GURL; |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 // Simpler version of ResourceHandleClient that lends itself to proxying. | 17 // Simpler version of ResourceHandleClient that lends itself to proxying. |
| 17 class WebPluginResourceClient { | 18 class WebPluginResourceClient { |
| 18 public: | 19 public: |
| 19 virtual ~WebPluginResourceClient() {} | 20 virtual ~WebPluginResourceClient() {} |
| 20 | 21 |
| 21 virtual void WillSendRequest(const GURL& url, int http_status_code) = 0; | 22 virtual void WillSendRequest(const GURL& url, int http_status_code) = 0; |
| 22 // The request_is_seekable parameter indicates whether byte range requests | 23 // The request_is_seekable parameter indicates whether byte range requests |
| 23 // can be issued for the underlying stream. | 24 // can be issued for the underlying stream. |
| 24 virtual void DidReceiveResponse(const std::string& mime_type, | 25 virtual void DidReceiveResponse(const std::string& mime_type, |
| 25 const std::string& headers, | 26 const std::string& headers, |
| 26 uint32 expected_length, | 27 uint32_t expected_length, |
| 27 uint32 last_modified, | 28 uint32_t last_modified, |
| 28 bool request_is_seekable) = 0; | 29 bool request_is_seekable) = 0; |
| 29 virtual void DidReceiveData(const char* buffer, int length, | 30 virtual void DidReceiveData(const char* buffer, int length, |
| 30 int data_offset) = 0; | 31 int data_offset) = 0; |
| 31 // The resource ids passed here ensures that data for range requests | 32 // The resource ids passed here ensures that data for range requests |
| 32 // is cleared. This applies for seekable streams. | 33 // is cleared. This applies for seekable streams. |
| 33 virtual void DidFinishLoading(unsigned long resource_id) = 0; | 34 virtual void DidFinishLoading(unsigned long resource_id) = 0; |
| 34 virtual void DidFail(unsigned long resource_id) = 0; | 35 virtual void DidFail(unsigned long resource_id) = 0; |
| 35 virtual int ResourceId() = 0; | 36 virtual int ResourceId() = 0; |
| 36 // Tells this object that it will get responses from multiple resources. | 37 // Tells this object that it will get responses from multiple resources. |
| 37 // This is necessary since the plugin process uses a single instance of | 38 // This is necessary since the plugin process uses a single instance of |
| 38 // PluginStreamUrl object for multiple range requests. | 39 // PluginStreamUrl object for multiple range requests. |
| 39 virtual void AddRangeRequestResourceId(unsigned long resource_id) { } | 40 virtual void AddRangeRequestResourceId(unsigned long resource_id) { } |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace content | 43 } // namespace content |
| 43 | 44 |
| 44 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_RESOURCE_CLIENT_H_ | 45 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_RESOURCE_CLIENT_H_ |
| OLD | NEW |