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

Unified Diff: content/browser/streams/stream_handle_impl.cc

Issue 12645004: Add Resource Handler for creating Streams to forward to extensions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Stream Resource Throttle Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/streams/stream_handle_impl.h ('k') | content/browser/streams/stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/streams/stream_handle_impl.cc
diff --git a/content/browser/streams/stream_handle_impl.cc b/content/browser/streams/stream_handle_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..11f69592b6f82405a2a02d635c7c00bf61d22a36
--- /dev/null
+++ b/content/browser/streams/stream_handle_impl.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/streams/stream_handle_impl.h"
+
+#include "content/browser/streams/stream.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace content {
+
+StreamHandleImpl::StreamHandleImpl(const base::WeakPtr<Stream>& stream,
+ const GURL& original_url,
+ const std::string& mime_type)
+ : stream_(stream),
+ url_(stream->url()),
+ original_url_(original_url),
+ mime_type_(mime_type),
+ stream_message_loop_(base::MessageLoopProxy::current()) {
+}
+
+StreamHandleImpl::~StreamHandleImpl() {
+ stream_message_loop_->PostTask(FROM_HERE,
+ base::Bind(&Stream::CloseHandle, stream_));
+}
+
+const GURL& StreamHandleImpl::GetURL() {
+ return url_;
+}
+
+const GURL& StreamHandleImpl::GetOriginalURL() {
+ return original_url_;
+}
+
+const std::string& StreamHandleImpl::GetMimeType() {
+ return mime_type_;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/streams/stream_handle_impl.h ('k') | content/browser/streams/stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698