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

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

Issue 2535483002: Plumb site engagement to the renderer process. (Closed)
Patch Set: Rebase. Fix Win compile 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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 ChildThreadImpl::GetRouter()->AddRoute(routing_id, listener); 1097 ChildThreadImpl::GetRouter()->AddRoute(routing_id, listener);
1098 auto it = pending_frame_creates_.find(routing_id); 1098 auto it = pending_frame_creates_.find(routing_id);
1099 if (it == pending_frame_creates_.end()) 1099 if (it == pending_frame_creates_.end())
1100 return; 1100 return;
1101 1101
1102 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(routing_id); 1102 RenderFrameImpl* frame = RenderFrameImpl::FromRoutingID(routing_id);
1103 if (!frame) 1103 if (!frame)
1104 return; 1104 return;
1105 1105
1106 scoped_refptr<PendingFrameCreate> create(it->second); 1106 scoped_refptr<PendingFrameCreate> create(it->second);
1107 frame->Bind(it->second->TakeFrameRequest(), it->second->TakeFrameHost()); 1107 frame->BindFrame(it->second->TakeFrameRequest(), it->second->TakeFrameHost());
1108 pending_frame_creates_.erase(it); 1108 pending_frame_creates_.erase(it);
1109 } 1109 }
1110 1110
1111 void RenderThreadImpl::RemoveRoute(int32_t routing_id) { 1111 void RenderThreadImpl::RemoveRoute(int32_t routing_id) {
1112 ChildThreadImpl::GetRouter()->RemoveRoute(routing_id); 1112 ChildThreadImpl::GetRouter()->RemoveRoute(routing_id);
1113 } 1113 }
1114 1114
1115 void RenderThreadImpl::AddEmbeddedWorkerRoute(int32_t routing_id, 1115 void RenderThreadImpl::AddEmbeddedWorkerRoute(int32_t routing_id,
1116 IPC::Listener* listener) { 1116 IPC::Listener* listener) {
1117 AddRoute(routing_id, listener); 1117 AddRoute(routing_id, listener);
(...skipping 1367 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