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_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ |
6 #define CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ | 6 #define CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 void SetPluginURLFetcher(PluginURLFetcher* fetcher); | 33 void SetPluginURLFetcher(PluginURLFetcher* fetcher); |
34 | 34 |
35 void URLRedirectResponse(bool allow); | 35 void URLRedirectResponse(bool allow); |
36 | 36 |
37 void FetchRange(const std::string& range); | 37 void FetchRange(const std::string& range); |
38 | 38 |
39 // Stop sending the stream to the client. | 39 // Stop sending the stream to the client. |
40 // Overrides the base Close so we can cancel our fetching the URL if | 40 // Overrides the base Close so we can cancel our fetching the URL if |
41 // it is still loading. | 41 // it is still loading. |
42 virtual bool Close(NPReason reason) override; | 42 bool Close(NPReason reason) override; |
43 virtual WebPluginResourceClient* AsResourceClient() override; | 43 WebPluginResourceClient* AsResourceClient() override; |
44 virtual void CancelRequest() override; | 44 void CancelRequest() override; |
45 | 45 |
46 // WebPluginResourceClient methods | 46 // WebPluginResourceClient methods |
47 virtual void WillSendRequest(const GURL& url, int http_status_code) override; | 47 void WillSendRequest(const GURL& url, int http_status_code) override; |
48 virtual void DidReceiveResponse(const std::string& mime_type, | 48 void DidReceiveResponse(const std::string& mime_type, |
49 const std::string& headers, | 49 const std::string& headers, |
50 uint32 expected_length, | 50 uint32 expected_length, |
51 uint32 last_modified, | 51 uint32 last_modified, |
52 bool request_is_seekable) override; | 52 bool request_is_seekable) override; |
53 virtual void DidReceiveData(const char* buffer, | 53 void DidReceiveData(const char* buffer, int length, int data_offset) override; |
54 int length, | 54 void DidFinishLoading(unsigned long resource_id) override; |
55 int data_offset) override; | 55 void DidFail(unsigned long resource_id) override; |
56 virtual void DidFinishLoading(unsigned long resource_id) override; | 56 bool IsMultiByteResponseExpected() override; |
57 virtual void DidFail(unsigned long resource_id) override; | 57 int ResourceId() override; |
58 virtual bool IsMultiByteResponseExpected() override; | 58 void AddRangeRequestResourceId(unsigned long resource_id) override; |
59 virtual int ResourceId() override; | |
60 virtual void AddRangeRequestResourceId(unsigned long resource_id) override; | |
61 | 59 |
62 protected: | 60 protected: |
63 virtual ~PluginStreamUrl(); | 61 ~PluginStreamUrl() override; |
64 | 62 |
65 private: | 63 private: |
66 void SetDeferLoading(bool value); | 64 void SetDeferLoading(bool value); |
67 | 65 |
68 // In case of a redirect, this can be called to update the url. But it must | 66 // In case of a redirect, this can be called to update the url. But it must |
69 // be called before Open(). | 67 // be called before Open(). |
70 void UpdateUrl(const char* url); | 68 void UpdateUrl(const char* url); |
71 | 69 |
72 GURL url_; | 70 GURL url_; |
73 unsigned long id_; | 71 unsigned long id_; |
(...skipping 12 matching lines...) Expand all Loading... |
86 std::string pending_redirect_url_; | 84 std::string pending_redirect_url_; |
87 | 85 |
88 scoped_ptr<PluginURLFetcher> plugin_url_fetcher_; | 86 scoped_ptr<PluginURLFetcher> plugin_url_fetcher_; |
89 | 87 |
90 DISALLOW_COPY_AND_ASSIGN(PluginStreamUrl); | 88 DISALLOW_COPY_AND_ASSIGN(PluginStreamUrl); |
91 }; | 89 }; |
92 | 90 |
93 } // namespace content | 91 } // namespace content |
94 | 92 |
95 #endif // CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ | 93 #endif // CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ |
OLD | NEW |