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

Side by Side Diff: blimp/client/session/blimp_client_session.cc

Issue 2250433006: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 "blimp/client/session/blimp_client_session.h" 5 #include "blimp/client/session/blimp_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 29 matching lines...) Expand all
40 tab_control_feature_(new TabControlFeature), 40 tab_control_feature_(new TabControlFeature),
41 navigation_feature_(new NavigationFeature), 41 navigation_feature_(new NavigationFeature),
42 ime_feature_(new ImeFeature), 42 ime_feature_(new ImeFeature),
43 render_widget_feature_(new RenderWidgetFeature), 43 render_widget_feature_(new RenderWidgetFeature),
44 settings_feature_(new SettingsFeature), 44 settings_feature_(new SettingsFeature),
45 weak_factory_(this) { 45 weak_factory_(this) {
46 base::Thread::Options options; 46 base::Thread::Options options;
47 options.message_loop_type = base::MessageLoop::TYPE_IO; 47 options.message_loop_type = base::MessageLoop::TYPE_IO;
48 io_thread_.StartWithOptions(options); 48 io_thread_.StartWithOptions(options);
49 net_components_.reset(new ClientNetworkComponents( 49 net_components_.reset(new ClientNetworkComponents(
50 base::WrapUnique(new CrossThreadNetworkEventObserver( 50 base::MakeUnique<CrossThreadNetworkEventObserver>(
51 weak_factory_.GetWeakPtr(), 51 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get())));
52 base::SequencedTaskRunnerHandle::Get()))));
53 52
54 assignment_source_.reset(new AssignmentSource( 53 assignment_source_.reset(new AssignmentSource(
55 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); 54 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner()));
56 55
57 std::unique_ptr<HeliumBlobReceiverDelegate> blob_delegate( 56 std::unique_ptr<HeliumBlobReceiverDelegate> blob_delegate(
58 new HeliumBlobReceiverDelegate); 57 new HeliumBlobReceiverDelegate);
59 blob_delegate_ = blob_delegate.get(); 58 blob_delegate_ = blob_delegate.get();
60 blob_receiver_ = BlobChannelReceiver::Create( 59 blob_receiver_ = BlobChannelReceiver::Create(
61 base::WrapUnique(new InMemoryBlobCache), std::move(blob_delegate)); 60 base::WrapUnique(new InMemoryBlobCache), std::move(blob_delegate));
62 61
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 FROM_HERE, 97 FROM_HERE,
99 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, 98 base::Bind(&ClientNetworkComponents::ConnectWithAssignment,
100 base::Unretained(net_components_.get()), assignment)); 99 base::Unretained(net_components_.get()), assignment));
101 } 100 }
102 101
103 void BlimpClientSession::OnAssignmentConnectionAttempted( 102 void BlimpClientSession::OnAssignmentConnectionAttempted(
104 AssignmentRequestResult result, 103 AssignmentRequestResult result,
105 const Assignment& assignment) {} 104 const Assignment& assignment) {}
106 105
107 void BlimpClientSession::RegisterFeatures() { 106 void BlimpClientSession::RegisterFeatures() {
108 thread_pipe_manager_ = base::WrapUnique( 107 thread_pipe_manager_ = base::MakeUnique<ThreadPipeManager>(
109 new ThreadPipeManager(io_thread_.task_runner(), 108 io_thread_.task_runner(), net_components_->GetBrowserConnectionHandler());
110 net_components_->GetBrowserConnectionHandler()));
111 109
112 // Register features' message senders and receivers. 110 // Register features' message senders and receivers.
113 tab_control_feature_->set_outgoing_message_processor( 111 tab_control_feature_->set_outgoing_message_processor(
114 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, 112 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl,
115 tab_control_feature_.get())); 113 tab_control_feature_.get()));
116 navigation_feature_->set_outgoing_message_processor( 114 navigation_feature_->set_outgoing_message_processor(
117 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, 115 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation,
118 navigation_feature_.get())); 116 navigation_feature_.get()));
119 render_widget_feature_->set_outgoing_input_message_processor( 117 render_widget_feature_->set_outgoing_input_message_processor(
120 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, 118 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { 167 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const {
170 return render_widget_feature_.get(); 168 return render_widget_feature_.get();
171 } 169 }
172 170
173 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { 171 SettingsFeature* BlimpClientSession::GetSettingsFeature() const {
174 return settings_feature_.get(); 172 return settings_feature_.get();
175 } 173 }
176 174
177 } // namespace client 175 } // namespace client
178 } // namespace blimp 176 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/feature/compositor/blimp_input_manager.cc ('k') | blimp/engine/feature/geolocation/engine_geolocation_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698