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

Unified Diff: services/navigation/view_impl.cc

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « services/navigation/view_impl.h ('k') | services/shell/public/cpp/connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/navigation/view_impl.cc
diff --git a/services/navigation/view_impl.cc b/services/navigation/view_impl.cc
index 6bb54cf854423e107e93c7a49102bcea760f1485..9a85fec040dd468aeb3d1e46b69f5b49aaa8d505 100644
--- a/services/navigation/view_impl.cc
+++ b/services/navigation/view_impl.cc
@@ -15,6 +15,7 @@
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents.h"
+#include "services/shell/public/cpp/connector.h"
#include "services/ui/public/cpp/window_tree_client.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/mus/native_widget_mus.h"
@@ -56,12 +57,12 @@ mojom::NavigationEntryPtr EntryPtrFromNavEntry(
} // namespace
-ViewImpl::ViewImpl(shell::Connector* connector,
+ViewImpl::ViewImpl(std::unique_ptr<shell::Connector> connector,
const std::string& client_user_id,
mojom::ViewClientPtr client,
mojom::ViewRequest request,
std::unique_ptr<shell::ServiceContextRef> ref)
- : connector_(connector),
+ : connector_(std::move(connector)),
binding_(this, std::move(request)),
client_(std::move(client)),
ref_(std::move(ref)),
@@ -148,8 +149,9 @@ void ViewImpl::AddNewContents(content::WebContents* source,
const std::string new_user_id =
content::BrowserContext::GetShellUserIdFor(
new_contents->GetBrowserContext());
- ViewImpl* impl = new ViewImpl(connector_, new_user_id, std::move(client),
- std::move(view_request), ref_->Clone());
+ ViewImpl* impl = new ViewImpl(
+ connector_->Clone(), new_user_id, std::move(client),
+ std::move(view_request), ref_->Clone());
// TODO(beng): This is a bit crappy. should be able to create the ViewImpl
// with |new_contents| instead.
impl->web_view_->SetWebContents(new_contents);
@@ -272,7 +274,7 @@ void ViewImpl::OnEmbed(ui::Window* root) {
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.delegate = this;
params.native_widget = new views::NativeWidgetMus(
- widget_.get(), connector_, root, ui::mojom::SurfaceType::DEFAULT);
+ widget_.get(), connector_.get(), root, ui::mojom::SurfaceType::DEFAULT);
widget_->Init(params);
widget_->Show();
}
« no previous file with comments | « services/navigation/view_impl.h ('k') | services/shell/public/cpp/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698