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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 scoped_refptr<Stream> stream(GetStreamForURL(url)); | 665 scoped_refptr<Stream> stream(GetStreamForURL(url)); |
666 if (stream.get()) | 666 if (stream.get()) |
667 stream->Abort(); | 667 stream->Abort(); |
668 } | 668 } |
669 | 669 |
670 void FileAPIMessageFilter::OnCloneStream( | 670 void FileAPIMessageFilter::OnCloneStream( |
671 const GURL& url, const GURL& src_url) { | 671 const GURL& url, const GURL& src_url) { |
672 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 672 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
673 // Abort if there's no Stream instance for |src_url| (source Stream which | 673 // Abort if there's no Stream instance for |src_url| (source Stream which |
674 // we're going to make |url| point to) in the registry. | 674 // we're going to make |url| point to) in the registry. |
675 if (!GetStreamForURL(src_url)) | 675 if (!GetStreamForURL(src_url).get()) |
676 return; | 676 return; |
677 | 677 |
678 stream_context_->registry()->CloneStream(url, src_url); | 678 stream_context_->registry()->CloneStream(url, src_url); |
679 stream_urls_.insert(url.spec()); | 679 stream_urls_.insert(url.spec()); |
680 } | 680 } |
681 | 681 |
682 void FileAPIMessageFilter::OnRemoveStream(const GURL& url) { | 682 void FileAPIMessageFilter::OnRemoveStream(const GURL& url) { |
683 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 683 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
684 | 684 |
685 if (!GetStreamForURL(url).get()) | 685 if (!GetStreamForURL(url).get()) |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 } | 872 } |
873 | 873 |
874 return true; | 874 return true; |
875 } | 875 } |
876 | 876 |
877 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { | 877 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { |
878 return stream_context_->registry()->GetStream(url); | 878 return stream_context_->registry()->GetStream(url); |
879 } | 879 } |
880 | 880 |
881 } // namespace content | 881 } // namespace content |
OLD | NEW |