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

Side by Side Diff: content/test/test_render_frame.cc

Issue 2824193002: Enable use_once_callback for //content/common/*.mojom (Closed)
Patch Set: rebase Created 3 years, 7 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/renderer/service_worker/service_worker_context_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/test_render_frame.h" 5 #include "content/test/test_render_frame.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/common/navigation_params.h" 8 #include "content/common/navigation_params.h"
9 #include "content/common/resource_request_body_impl.h" 9 #include "content/common/resource_request_body_impl.h"
10 #include "content/public/common/associated_interface_provider.h" 10 #include "content/public/common/associated_interface_provider.h"
11 #include "content/public/common/browser_side_navigation_policy.h" 11 #include "content/public/common/browser_side_navigation_policy.h"
12 #include "content/public/common/resource_response.h" 12 #include "content/public/common/resource_response.h"
13 #include "content/public/test/mock_render_thread.h" 13 #include "content/public/test/mock_render_thread.h"
14 #include "third_party/WebKit/public/web/WebLocalFrame.h" 14 #include "third_party/WebKit/public/web/WebLocalFrame.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 class MockFrameHost : public mojom::FrameHost { 18 class MockFrameHost : public mojom::FrameHost {
19 public: 19 public:
20 MockFrameHost() : binding_(this) {} 20 MockFrameHost() : binding_(this) {}
21 ~MockFrameHost() override = default; 21 ~MockFrameHost() override = default;
22 22
23 void CreateNewWindow(mojom::CreateNewWindowParamsPtr params, 23 void CreateNewWindow(mojom::CreateNewWindowParamsPtr params,
24 const CreateNewWindowCallback& callback) override { 24 CreateNewWindowCallback callback) override {
25 mojom::CreateNewWindowReplyPtr reply = mojom::CreateNewWindowReply::New(); 25 mojom::CreateNewWindowReplyPtr reply = mojom::CreateNewWindowReply::New();
26 MockRenderThread* mock_render_thread = 26 MockRenderThread* mock_render_thread =
27 static_cast<MockRenderThread*>(RenderThread::Get()); 27 static_cast<MockRenderThread*>(RenderThread::Get());
28 mock_render_thread->OnCreateWindow(*params, reply.get()); 28 mock_render_thread->OnCreateWindow(*params, reply.get());
29 callback.Run(std::move(reply)); 29 std::move(callback).Run(std::move(reply));
30 } 30 }
31 31
32 void Bind(mojo::ScopedInterfaceEndpointHandle handle) { 32 void Bind(mojo::ScopedInterfaceEndpointHandle handle) {
33 binding_.Bind( 33 binding_.Bind(
34 mojo::MakeAssociatedRequest<mojom::FrameHost>(std::move(handle))); 34 mojo::MakeAssociatedRequest<mojom::FrameHost>(std::move(handle)));
35 } 35 }
36 36
37 private: 37 private:
38 mojo::AssociatedBinding<mojom::FrameHost> binding_; 38 mojo::AssociatedBinding<mojom::FrameHost> binding_;
39 39
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 mojom::FrameHostAssociatedPtr TestRenderFrame::GetFrameHost() { 125 mojom::FrameHostAssociatedPtr TestRenderFrame::GetFrameHost() {
126 mojom::FrameHostAssociatedPtr ptr = RenderFrameImpl::GetFrameHost(); 126 mojom::FrameHostAssociatedPtr ptr = RenderFrameImpl::GetFrameHost();
127 127
128 // Needed to ensure no deadlocks when waiting for sync IPC. 128 // Needed to ensure no deadlocks when waiting for sync IPC.
129 ptr.FlushForTesting(); 129 ptr.FlushForTesting();
130 return ptr; 130 return ptr;
131 } 131 }
132 132
133 } // namespace content 133 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698