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

Side by Side Diff: extensions/browser/api/mime_handler_private/mime_handler_private.cc

Issue 1148703002: Remove mojo::InterfaceImpl from extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "extensions/browser/api/mime_handler_private/mime_handler_private.h" 5 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "content/public/browser/stream_handle.h" 8 #include "content/public/browser/stream_handle.h"
9 #include "content/public/browser/stream_info.h" 9 #include "content/public/browser/stream_info.h"
10 #include "content/public/common/content_constants.h" 10 #include "content/public/common/content_constants.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 return mojo::Map<mojo::String, mojo::String>::From(result); 43 return mojo::Map<mojo::String, mojo::String>::From(result);
44 } 44 }
45 45
46 } // namespace 46 } // namespace
47 47
48 // static 48 // static
49 void MimeHandlerServiceImpl::Create( 49 void MimeHandlerServiceImpl::Create(
50 base::WeakPtr<StreamContainer> stream_container, 50 base::WeakPtr<StreamContainer> stream_container,
51 mojo::InterfaceRequest<mime_handler::MimeHandlerService> request) { 51 mojo::InterfaceRequest<mime_handler::MimeHandlerService> request) {
52 mojo::BindToRequest(new MimeHandlerServiceImpl(stream_container), &request); 52 new MimeHandlerServiceImpl(stream_container, request.Pass());
53 } 53 }
54 54
55 MimeHandlerServiceImpl::MimeHandlerServiceImpl( 55 MimeHandlerServiceImpl::MimeHandlerServiceImpl(
56 base::WeakPtr<StreamContainer> stream_container) 56 base::WeakPtr<StreamContainer> stream_container,
57 : stream_(stream_container), weak_factory_(this) { 57 mojo::InterfaceRequest<mime_handler::MimeHandlerService> request)
58 : stream_(stream_container),
59 binding_(this, request.Pass()),
60 weak_factory_(this) {
58 } 61 }
59 62
60 MimeHandlerServiceImpl::~MimeHandlerServiceImpl() { 63 MimeHandlerServiceImpl::~MimeHandlerServiceImpl() {
61 } 64 }
62 65
63 void MimeHandlerServiceImpl::GetStreamInfo( 66 void MimeHandlerServiceImpl::GetStreamInfo(
64 const mojo::Callback<void(mime_handler::StreamInfoPtr)>& callback) { 67 const mojo::Callback<void(mime_handler::StreamInfoPtr)>& callback) {
65 if (!stream_) { 68 if (!stream_) {
66 callback.Run(mime_handler::StreamInfoPtr()); 69 callback.Run(mime_handler::StreamInfoPtr());
67 return; 70 return;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 result->original_url = info->original_url.spec(); 115 result->original_url = info->original_url.spec();
113 } 116 }
114 117
115 result->stream_url = info->handle->GetURL().spec(); 118 result->stream_url = info->handle->GetURL().spec();
116 result->response_headers = 119 result->response_headers =
117 extensions::CreateResponseHeadersMap(info->response_headers.get()); 120 extensions::CreateResponseHeadersMap(info->response_headers.get());
118 return result.Pass(); 121 return result.Pass();
119 } 122 }
120 123
121 } // namespace mojo 124 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698