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 #include "content/child/npapi/plugin_url_fetcher.h" | 5 #include "content/child/npapi/plugin_url_fetcher.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "content/child/child_thread.h" | 8 #include "content/child/child_thread.h" |
9 #include "content/child/multipart_response_delegate.h" | 9 #include "content/child/multipart_response_delegate.h" |
10 #include "content/child/npapi/plugin_host.h" | 10 #include "content/child/npapi/plugin_host.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // TODO(darin): Should we really exclude headers with an empty value? | 300 // TODO(darin): Should we really exclude headers with an empty value? |
301 if (!name.empty() && !value.empty()) | 301 if (!name.empty() && !value.empty()) |
302 headers += name + ": " + value + "\n"; | 302 headers += name + ": " + value + "\n"; |
303 } | 303 } |
304 | 304 |
305 // Bug http://b/issue?id=925559. The flash plugin would not handle the HTTP | 305 // Bug http://b/issue?id=925559. The flash plugin would not handle the HTTP |
306 // error codes in the stream header and as a result, was unaware of the fate | 306 // error codes in the stream header and as a result, was unaware of the fate |
307 // of the HTTP requests issued via NPN_GetURLNotify. Webkit and FF destroy | 307 // of the HTTP requests issued via NPN_GetURLNotify. Webkit and FF destroy |
308 // the stream and invoke the NPP_DestroyStream function on the plugin if the | 308 // the stream and invoke the NPP_DestroyStream function on the plugin if the |
309 // HTTPrequest fails. | 309 // HTTPrequest fails. |
310 if ((url_.SchemeIs("http") || url_.SchemeIs("https")) && | 310 if ((url_.SchemeIs(url::kHttpScheme) || url_.SchemeIs(url::kHttpsScheme)) && |
311 (response_code < 100 || response_code >= 400)) { | 311 (response_code < 100 || response_code >= 400)) { |
312 pending_failure_notification_ = true; | 312 pending_failure_notification_ = true; |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 plugin_stream_->DidReceiveResponse(info.mime_type, | 316 plugin_stream_->DidReceiveResponse(info.mime_type, |
317 headers, | 317 headers, |
318 expected_length, | 318 expected_length, |
319 last_modified, | 319 last_modified, |
320 request_is_seekable); | 320 request_is_seekable); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 366 } |
367 | 367 |
368 if (error_code == net::OK) { | 368 if (error_code == net::OK) { |
369 plugin_stream_->DidFinishLoading(resource_id_); | 369 plugin_stream_->DidFinishLoading(resource_id_); |
370 } else { | 370 } else { |
371 plugin_stream_->DidFail(resource_id_); | 371 plugin_stream_->DidFail(resource_id_); |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 } // namespace content | 375 } // namespace content |
OLD | NEW |