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

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

Issue 621613002: Refactoring: Make IPC::Channel::TakeClientFileDescriptor() a ScopedFD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Mac build Created 6 years, 2 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
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/ppapi_plugin_process_host.h" 5 #include "content/browser/ppapi_plugin_process_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 #elif defined(OS_POSIX) 71 #elif defined(OS_POSIX)
72 virtual bool ShouldUseZygote() override { 72 virtual bool ShouldUseZygote() override {
73 const base::CommandLine& browser_command_line = 73 const base::CommandLine& browser_command_line =
74 *base::CommandLine::ForCurrentProcess(); 74 *base::CommandLine::ForCurrentProcess();
75 base::CommandLine::StringType plugin_launcher = browser_command_line 75 base::CommandLine::StringType plugin_launcher = browser_command_line
76 .GetSwitchValueNative(switches::kPpapiPluginLauncher); 76 .GetSwitchValueNative(switches::kPpapiPluginLauncher);
77 return !is_broker_ && plugin_launcher.empty() && info_.is_sandboxed; 77 return !is_broker_ && plugin_launcher.empty() && info_.is_sandboxed;
78 } 78 }
79 virtual int GetIpcFd() override { 79 virtual base::ScopedFD TakeIpcFd() override {
80 return ipc_fd_; 80 return ipc_fd_.Pass();
81 } 81 }
82 #endif // OS_WIN 82 #endif // OS_WIN
83 83
84 private: 84 private:
85 #if defined(OS_POSIX) 85 #if defined(OS_POSIX)
86 const PepperPluginInfo& info_; 86 const PepperPluginInfo& info_;
87 int ipc_fd_; 87 base::ScopedFD ipc_fd_;
88 #endif // OS_POSIX 88 #endif // OS_POSIX
89 bool is_broker_; 89 bool is_broker_;
90 90
91 DISALLOW_COPY_AND_ASSIGN(PpapiPluginSandboxedProcessLauncherDelegate); 91 DISALLOW_COPY_AND_ASSIGN(PpapiPluginSandboxedProcessLauncherDelegate);
92 }; 92 };
93 93
94 class PpapiPluginProcessHost::PluginNetworkObserver 94 class PpapiPluginProcessHost::PluginNetworkObserver
95 : public net::NetworkChangeNotifier::IPAddressObserver, 95 : public net::NetworkChangeNotifier::IPAddressObserver,
96 public net::NetworkChangeNotifier::ConnectionTypeObserver { 96 public net::NetworkChangeNotifier::ConnectionTypeObserver {
97 public: 97 public:
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // sent_requests_ queue should be the one that the plugin just created. 464 // sent_requests_ queue should be the one that the plugin just created.
465 Client* client = sent_requests_.front(); 465 Client* client = sent_requests_.front();
466 sent_requests_.pop(); 466 sent_requests_.pop();
467 467
468 const ChildProcessData& data = process_->GetData(); 468 const ChildProcessData& data = process_->GetData();
469 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), 469 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle),
470 data.id); 470 data.id);
471 } 471 }
472 472
473 } // namespace content 473 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698