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

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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // We can receive a GetServiceProviderForFrame message for a frame not yet 345 // We can receive a GetServiceProviderForFrame message for a frame not yet
346 // created due to a race between the message and a 346 // created due to a race between the message and a
347 // mojom::Renderer::CreateView IPC that triggers creation of the RenderFrame 347 // mojom::Renderer::CreateView IPC that triggers creation of the RenderFrame
348 // we want. 348 // we want.
349 if (!frame) { 349 if (!frame) {
350 RenderThreadImpl::current()->RegisterPendingFrameCreate( 350 RenderThreadImpl::current()->RegisterPendingFrameCreate(
351 frame_routing_id, std::move(frame_request), std::move(frame_host)); 351 frame_routing_id, std::move(frame_request), std::move(frame_host));
352 return; 352 return;
353 } 353 }
354 354
355 frame->Bind(std::move(frame_request), std::move(frame_host)); 355 frame->BindFrame(std::move(frame_request), std::move(frame_host));
356 } 356 }
357 357
358 private: 358 private:
359 int32_t routing_id_highmark_; 359 int32_t routing_id_highmark_;
360 }; 360 };
361 361
362 void CreateFrameFactory(mojom::FrameFactoryRequest request) { 362 void CreateFrameFactory(mojom::FrameFactoryRequest request) {
363 mojo::MakeStrongBinding(base::MakeUnique<FrameFactoryImpl>(), 363 mojo::MakeStrongBinding(base::MakeUnique<FrameFactoryImpl>(),
364 std::move(request)); 364 std::move(request));
365 } 365 }
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 ChildThreadImpl::GetRouter()->AddRoute(routing_id, listener); 1094 ChildThreadImpl::GetRouter()->AddRoute(routing_id, listener);
1095 auto it = pending_frame_creates_.find(routing_id); 1095 auto it = pending_frame_creates_.find(routing_id);
1096 if (it == pending_frame_creates_.end()) 1096 if (it == pending_frame_creates_.end())
1097 return; 1097 return;
1098 1098
1099 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(routing_id); 1099 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(routing_id);
1100 if (!frame) 1100 if (!frame)
1101 return; 1101 return;
1102 1102
1103 scoped_refptr<PendingFrameCreate> create(it->second); 1103 scoped_refptr<PendingFrameCreate> create(it->second);
1104 frame->Bind(it->second->TakeFrameRequest(), it->second->TakeFrameHost()); 1104 frame->BindFrame(it->second->TakeFrameRequest(), it->second->TakeFrameHost());
1105 pending_frame_creates_.erase(it); 1105 pending_frame_creates_.erase(it);
1106 } 1106 }
1107 1107
1108 void RenderThreadImpl::RemoveRoute(int32_t routing_id) { 1108 void RenderThreadImpl::RemoveRoute(int32_t routing_id) {
1109 ChildThreadImpl::GetRouter()->RemoveRoute(routing_id); 1109 ChildThreadImpl::GetRouter()->RemoveRoute(routing_id);
1110 } 1110 }
1111 1111
1112 void RenderThreadImpl::AddEmbeddedWorkerRoute(int32_t routing_id, 1112 void RenderThreadImpl::AddEmbeddedWorkerRoute(int32_t routing_id,
1113 IPC::Listener* listener) { 1113 IPC::Listener* listener) {
1114 AddRoute(routing_id, listener); 1114 AddRoute(routing_id, listener);
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
2485 } 2485 }
2486 } 2486 }
2487 2487
2488 void RenderThreadImpl::OnRendererInterfaceRequest( 2488 void RenderThreadImpl::OnRendererInterfaceRequest(
2489 mojom::RendererAssociatedRequest request) { 2489 mojom::RendererAssociatedRequest request) {
2490 DCHECK(!renderer_binding_.is_bound()); 2490 DCHECK(!renderer_binding_.is_bound());
2491 renderer_binding_.Bind(std::move(request)); 2491 renderer_binding_.Bind(std::move(request));
2492 } 2492 }
2493 2493
2494 } // namespace content 2494 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698