Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/child/npapi/plugin_url_fetcher.cc

Issue 598453004: Replace some hard coded schemes with the constants in /url/url_constants.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address the comment. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/loader/resource_scheduler.cc ('k') | content/child/site_isolation_policy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/loader/resource_scheduler.cc ('k') | content/child/site_isolation_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698