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

Side by Side Diff: content/browser/plugin_service_impl_browsertest.cc

Issue 307653003: Introduce IPC::Channel::Create*() to ensure it being heap-allocated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows build, landing again. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/common/child_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/plugin_service_impl.h" 5 #include "content/browser/plugin_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual ResourceContext* GetResourceContext() OVERRIDE { 53 virtual ResourceContext* GetResourceContext() OVERRIDE {
54 return context_; 54 return context_;
55 } 55 }
56 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE {} 56 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE {}
57 virtual void OnSentPluginChannelRequest() OVERRIDE {} 57 virtual void OnSentPluginChannelRequest() OVERRIDE {}
58 58
59 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE { 59 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE {
60 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 60 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
61 ASSERT_TRUE(set_plugin_info_called_); 61 ASSERT_TRUE(set_plugin_info_called_);
62 ASSERT_TRUE(!channel_); 62 ASSERT_TRUE(!channel_);
63 channel_ = new IPC::Channel(handle, IPC::Channel::MODE_CLIENT, this); 63 channel_ = IPC::Channel::CreateClient(handle, this).release();
64 ASSERT_TRUE(channel_->Connect()); 64 ASSERT_TRUE(channel_->Connect());
65 } 65 }
66 66
67 virtual void SetPluginInfo(const WebPluginInfo& info) OVERRIDE { 67 virtual void SetPluginInfo(const WebPluginInfo& info) OVERRIDE {
68 ASSERT_TRUE(info.mime_types.size()); 68 ASSERT_TRUE(info.mime_types.size());
69 ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); 69 ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type);
70 set_plugin_info_called_ = true; 70 set_plugin_info_called_ = true;
71 } 71 }
72 72
73 virtual void OnError() OVERRIDE { 73 virtual void OnError() OVERRIDE {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 BrowserThread::IO, FROM_HERE, 368 BrowserThread::IO, FROM_HERE,
369 base::Bind(&OpenChannel, &mock_client)); 369 base::Bind(&OpenChannel, &mock_client));
370 RunMessageLoop(); 370 RunMessageLoop();
371 EXPECT_TRUE(mock_client.get_resource_context_called()); 371 EXPECT_TRUE(mock_client.get_resource_context_called());
372 EXPECT_TRUE(mock_client.set_plugin_info_called()); 372 EXPECT_TRUE(mock_client.set_plugin_info_called());
373 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); 373 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called());
374 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); 374 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called());
375 } 375 }
376 376
377 } // namespace content 377 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/common/child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698