| 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 #include "content/browser/fileapi/fileapi_message_filter.h" | 5 #include "content/browser/fileapi/fileapi_message_filter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 | 590 |
| 591 void FileAPIMessageFilter::OnRevokePublicBlobURL(const GURL& public_url) { | 591 void FileAPIMessageFilter::OnRevokePublicBlobURL(const GURL& public_url) { |
| 592 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 592 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 593 ignore_result(blob_storage_host_->RevokePublicBlobURL(public_url)); | 593 ignore_result(blob_storage_host_->RevokePublicBlobURL(public_url)); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void FileAPIMessageFilter::OnStartBuildingStream( | 596 void FileAPIMessageFilter::OnStartBuildingStream( |
| 597 const GURL& url, const std::string& content_type) { | 597 const GURL& url, const std::string& content_type) { |
| 598 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 598 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 599 // Only an internal Blob URL is expected here. See the BlobURL of the Blink. | 599 // Only an internal Blob URL is expected here. See the BlobURL of the Blink. |
| 600 if (!base::StartsWithASCII(url.path(), "blobinternal%3A///", | 600 if (!base::StartsWith(url.path(), "blobinternal%3A///", |
| 601 true /* case_sensitive */)) { | 601 base::CompareCase::SENSITIVE)) { |
| 602 NOTREACHED() << "Malformed Stream URL: " << url.spec(); | 602 NOTREACHED() << "Malformed Stream URL: " << url.spec(); |
| 603 bad_message::ReceivedBadMessage(this, | 603 bad_message::ReceivedBadMessage(this, |
| 604 bad_message::FAMF_MALFORMED_STREAM_URL); | 604 bad_message::FAMF_MALFORMED_STREAM_URL); |
| 605 return; | 605 return; |
| 606 } | 606 } |
| 607 // Use an empty security origin for now. Stream accepts a security origin | 607 // Use an empty security origin for now. Stream accepts a security origin |
| 608 // but how it's handled is not fixed yet. | 608 // but how it's handled is not fixed yet. |
| 609 new Stream(stream_context_->registry(), | 609 new Stream(stream_context_->registry(), |
| 610 NULL /* write_observer */, | 610 NULL /* write_observer */, |
| 611 url); | 611 url); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 } | 883 } |
| 884 | 884 |
| 885 return true; | 885 return true; |
| 886 } | 886 } |
| 887 | 887 |
| 888 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { | 888 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { |
| 889 return stream_context_->registry()->GetStream(url); | 889 return stream_context_->registry()->GetStream(url); |
| 890 } | 890 } |
| 891 | 891 |
| 892 } // namespace content | 892 } // namespace content |
| OLD | NEW |