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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2535483002: Plumb site engagement to the renderer process. (Closed)
Patch Set: Address comments Created 4 years 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 (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 "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // We can receive a GetServiceProviderForFrame message for a frame not yet 346 // We can receive a GetServiceProviderForFrame message for a frame not yet
347 // created due to a race between the message and a 347 // created due to a race between the message and a
348 // mojom::Renderer::CreateView IPC that triggers creation of the RenderFrame 348 // mojom::Renderer::CreateView IPC that triggers creation of the RenderFrame
349 // we want. 349 // we want.
350 if (!frame) { 350 if (!frame) {
351 RenderThreadImpl::current()->RegisterPendingFrameCreate( 351 RenderThreadImpl::current()->RegisterPendingFrameCreate(
352 frame_routing_id, std::move(frame_request), std::move(frame_host)); 352 frame_routing_id, std::move(frame_request), std::move(frame_host));
353 return; 353 return;
354 } 354 }
355 355
356 frame->Bind(std::move(frame_request), std::move(frame_host)); 356 frame->BindFrame(std::move(frame_request), std::move(frame_host));
357 } 357 }
358 358
359 private: 359 private:
360 int32_t routing_id_highmark_; 360 int32_t routing_id_highmark_;
361 }; 361 };
362 362
363 void CreateFrameFactory(mojom::FrameFactoryRequest request) { 363 void CreateFrameFactory(mojom::FrameFactoryRequest request) {
364 mojo::MakeStrongBinding(base::MakeUnique<FrameFactoryImpl>(), 364 mojo::MakeStrongBinding(base::MakeUnique<FrameFactoryImpl>(),
365 std::move(request)); 365 std::move(request));
366 } 366 }
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 ChildThreadImpl::GetRouter()->AddRoute(routing_id, listener); 1117 ChildThreadImpl::GetRouter()->AddRoute(routing_id, listener);
1118 auto it = pending_frame_creates_.find(routing_id); 1118 auto it = pending_frame_creates_.find(routing_id);
1119 if (it == pending_frame_creates_.end()) 1119 if (it == pending_frame_creates_.end())
1120 return; 1120 return;
1121 1121
1122 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(routing_id); 1122 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(routing_id);
1123 if (!frame) 1123 if (!frame)
1124 return; 1124 return;
1125 1125
1126 scoped_refptr<PendingFrameCreate> create(it->second); 1126 scoped_refptr<PendingFrameCreate> create(it->second);
1127 frame->Bind(it->second->TakeFrameRequest(), it->second->TakeFrameHost()); 1127 frame->BindFrame(it->second->TakeFrameRequest(), it->second->TakeFrameHost());
1128 pending_frame_creates_.erase(it); 1128 pending_frame_creates_.erase(it);
1129 } 1129 }
1130 1130
1131 void RenderThreadImpl::RemoveRoute(int32_t routing_id) { 1131 void RenderThreadImpl::RemoveRoute(int32_t routing_id) {
1132 ChildThreadImpl::GetRouter()->RemoveRoute(routing_id); 1132 ChildThreadImpl::GetRouter()->RemoveRoute(routing_id);
1133 } 1133 }
1134 1134
1135 void RenderThreadImpl::AddEmbeddedWorkerRoute(int32_t routing_id, 1135 void RenderThreadImpl::AddEmbeddedWorkerRoute(int32_t routing_id,
1136 IPC::Listener* listener) { 1136 IPC::Listener* listener) {
1137 AddRoute(routing_id, listener); 1137 AddRoute(routing_id, listener);
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 } 2512 }
2513 } 2513 }
2514 2514
2515 void RenderThreadImpl::OnRendererInterfaceRequest( 2515 void RenderThreadImpl::OnRendererInterfaceRequest(
2516 mojom::RendererAssociatedRequest request) { 2516 mojom::RendererAssociatedRequest request) {
2517 DCHECK(!renderer_binding_.is_bound()); 2517 DCHECK(!renderer_binding_.is_bound());
2518 renderer_binding_.Bind(std::move(request)); 2518 renderer_binding_.Bind(std::move(request));
2519 } 2519 }
2520 2520
2521 } // namespace content 2521 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698