| 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 "chrome/browser/extensions/api/streams_private/streams_private_api.h" | 5 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
| 10 #include "chrome/common/extensions/api/streams_private.h" | 10 #include "chrome/common/extensions/api/streams_private.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 int size = -1; | 105 int size = -1; |
| 106 if (expected_content_size <= INT_MAX) | 106 if (expected_content_size <= INT_MAX) |
| 107 size = expected_content_size; | 107 size = expected_content_size; |
| 108 info.expected_content_size = size; | 108 info.expected_content_size = size; |
| 109 | 109 |
| 110 CreateResponseHeadersDictionary(stream->response_headers.get(), | 110 CreateResponseHeadersDictionary(stream->response_headers.get(), |
| 111 &info.response_headers.additional_properties); | 111 &info.response_headers.additional_properties); |
| 112 | 112 |
| 113 scoped_ptr<Event> event( | 113 scoped_ptr<Event> event(new Event( |
| 114 new Event(streams_private::OnExecuteMimeTypeHandler::kEventName, | 114 events::UNKNOWN, streams_private::OnExecuteMimeTypeHandler::kEventName, |
| 115 streams_private::OnExecuteMimeTypeHandler::Create(info))); | 115 streams_private::OnExecuteMimeTypeHandler::Create(info))); |
| 116 | 116 |
| 117 EventRouter::Get(browser_context_) | 117 EventRouter::Get(browser_context_) |
| 118 ->DispatchEventToExtension(extension_id, event.Pass()); | 118 ->DispatchEventToExtension(extension_id, event.Pass()); |
| 119 | 119 |
| 120 GURL url = stream->handle->GetURL(); | 120 GURL url = stream->handle->GetURL(); |
| 121 streams_[extension_id][url] = make_linked_ptr(stream->handle.release()); | 121 streams_[extension_id][url] = make_linked_ptr(stream->handle.release()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void StreamsPrivateAPI::AbortStream(const std::string& extension_id, | 124 void StreamsPrivateAPI::AbortStream(const std::string& extension_id, |
| 125 const GURL& stream_url, | 125 const GURL& stream_url, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > | 168 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > |
| 169 g_factory = LAZY_INSTANCE_INITIALIZER; | 169 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 170 | 170 |
| 171 // static | 171 // static |
| 172 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* | 172 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* |
| 173 StreamsPrivateAPI::GetFactoryInstance() { | 173 StreamsPrivateAPI::GetFactoryInstance() { |
| 174 return g_factory.Pointer(); | 174 return g_factory.Pointer(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace extensions | 177 } // namespace extensions |
| OLD | NEW |