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

Side by Side Diff: content/child/indexed_db/webidbfactory_impl.cc

Issue 2695333002: Mojo C++ bindings: remove usage of AssociatedGroup from content/ (Closed)
Patch Set: . Created 3 years, 10 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
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.cc ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/child/indexed_db/webidbfactory_impl.h" 5 #include "content/child/indexed_db/webidbfactory_impl.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/child/indexed_db/indexed_db_callbacks_impl.h" 8 #include "content/child/indexed_db/indexed_db_callbacks_impl.h"
9 #include "content/child/indexed_db/indexed_db_database_callbacks_impl.h" 9 #include "content/child/indexed_db/indexed_db_database_callbacks_impl.h"
10 #include "content/child/storage_util.h" 10 #include "content/child/storage_util.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 FactoryAssociatedPtr& WebIDBFactoryImpl::IOThreadHelper::GetService() { 118 FactoryAssociatedPtr& WebIDBFactoryImpl::IOThreadHelper::GetService() {
119 if (!service_) 119 if (!service_)
120 sync_message_filter_->GetRemoteAssociatedInterface(&service_); 120 sync_message_filter_->GetRemoteAssociatedInterface(&service_);
121 return service_; 121 return service_;
122 } 122 }
123 123
124 CallbacksAssociatedPtrInfo WebIDBFactoryImpl::IOThreadHelper::GetCallbacksProxy( 124 CallbacksAssociatedPtrInfo WebIDBFactoryImpl::IOThreadHelper::GetCallbacksProxy(
125 std::unique_ptr<IndexedDBCallbacksImpl> callbacks) { 125 std::unique_ptr<IndexedDBCallbacksImpl> callbacks) {
126 CallbacksAssociatedPtrInfo ptr_info; 126 CallbacksAssociatedPtrInfo ptr_info;
127 indexed_db::mojom::CallbacksAssociatedRequest request; 127 auto request = mojo::MakeRequest(&ptr_info);
128 GetService().associated_group()->CreateAssociatedInterface(
129 mojo::AssociatedGroup::WILL_PASS_PTR, &ptr_info, &request);
130 mojo::MakeStrongAssociatedBinding(std::move(callbacks), std::move(request)); 128 mojo::MakeStrongAssociatedBinding(std::move(callbacks), std::move(request));
131 return ptr_info; 129 return ptr_info;
132 } 130 }
133 131
134 DatabaseCallbacksAssociatedPtrInfo 132 DatabaseCallbacksAssociatedPtrInfo
135 WebIDBFactoryImpl::IOThreadHelper::GetDatabaseCallbacksProxy( 133 WebIDBFactoryImpl::IOThreadHelper::GetDatabaseCallbacksProxy(
136 std::unique_ptr<IndexedDBDatabaseCallbacksImpl> callbacks) { 134 std::unique_ptr<IndexedDBDatabaseCallbacksImpl> callbacks) {
137 DatabaseCallbacksAssociatedPtrInfo ptr_info; 135 DatabaseCallbacksAssociatedPtrInfo ptr_info;
138 indexed_db::mojom::DatabaseCallbacksAssociatedRequest request; 136 auto request = mojo::MakeRequest(&ptr_info);
139 GetService().associated_group()->CreateAssociatedInterface(
140 mojo::AssociatedGroup::WILL_PASS_PTR, &ptr_info, &request);
141 mojo::MakeStrongAssociatedBinding(std::move(callbacks), std::move(request)); 137 mojo::MakeStrongAssociatedBinding(std::move(callbacks), std::move(request));
142 return ptr_info; 138 return ptr_info;
143 } 139 }
144 140
145 void WebIDBFactoryImpl::IOThreadHelper::GetDatabaseNames( 141 void WebIDBFactoryImpl::IOThreadHelper::GetDatabaseNames(
146 std::unique_ptr<IndexedDBCallbacksImpl> callbacks, 142 std::unique_ptr<IndexedDBCallbacksImpl> callbacks,
147 const url::Origin& origin) { 143 const url::Origin& origin) {
148 GetService()->GetDatabaseNames(GetCallbacksProxy(std::move(callbacks)), 144 GetService()->GetDatabaseNames(GetCallbacksProxy(std::move(callbacks)),
149 origin); 145 origin);
150 } 146 }
(...skipping 13 matching lines...) Expand all
164 void WebIDBFactoryImpl::IOThreadHelper::DeleteDatabase( 160 void WebIDBFactoryImpl::IOThreadHelper::DeleteDatabase(
165 const base::string16& name, 161 const base::string16& name,
166 std::unique_ptr<IndexedDBCallbacksImpl> callbacks, 162 std::unique_ptr<IndexedDBCallbacksImpl> callbacks,
167 const url::Origin& origin, 163 const url::Origin& origin,
168 bool force_close) { 164 bool force_close) {
169 GetService()->DeleteDatabase(GetCallbacksProxy(std::move(callbacks)), origin, 165 GetService()->DeleteDatabase(GetCallbacksProxy(std::move(callbacks)), origin,
170 name, force_close); 166 name, force_close);
171 } 167 }
172 168
173 } // namespace content 169 } // namespace content
OLDNEW
« no previous file with comments | « content/child/indexed_db/webidbdatabase_impl.cc ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698