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

Side by Side Diff: content/browser/gpu/gpu_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/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 log_file_path.c_str()); 243 log_file_path.c_str());
244 if (result != sandbox::SBOX_ALL_OK) { 244 if (result != sandbox::SBOX_ALL_OK) {
245 *success = false; 245 *success = false;
246 return; 246 return;
247 } 247 }
248 } 248 }
249 } 249 }
250 } 250 }
251 #elif defined(OS_POSIX) 251 #elif defined(OS_POSIX)
252 252
253 virtual int GetIpcFd() override { 253 virtual base::ScopedFD TakeIpcFd() override {
254 return ipc_fd_; 254 return ipc_fd_.Pass();
255 } 255 }
256 #endif // OS_WIN 256 #endif // OS_WIN
257 257
258 private: 258 private:
259 #if defined(OS_WIN) 259 #if defined(OS_WIN)
260 base::CommandLine* cmd_line_; 260 base::CommandLine* cmd_line_;
261 #elif defined(OS_POSIX) 261 #elif defined(OS_POSIX)
262 int ipc_fd_; 262 base::ScopedFD ipc_fd_;
263 #endif // OS_WIN 263 #endif // OS_WIN
264 }; 264 };
265 265
266 } // anonymous namespace 266 } // anonymous namespace
267 267
268 // static 268 // static
269 bool GpuProcessHost::ValidateHost(GpuProcessHost* host) { 269 bool GpuProcessHost::ValidateHost(GpuProcessHost* host) {
270 // The Gpu process is invalid if it's not using SwiftShader, the card is 270 // The Gpu process is invalid if it's not using SwiftShader, the card is
271 // blacklisted, and we can kill it and start over. 271 // blacklisted, and we can kill it and start over.
272 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 272 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1062 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1063 ClientIdToShaderCacheMap::iterator iter = 1063 ClientIdToShaderCacheMap::iterator iter =
1064 client_id_to_shader_cache_.find(client_id); 1064 client_id_to_shader_cache_.find(client_id);
1065 // If the cache doesn't exist then this is an off the record profile. 1065 // If the cache doesn't exist then this is an off the record profile.
1066 if (iter == client_id_to_shader_cache_.end()) 1066 if (iter == client_id_to_shader_cache_.end())
1067 return; 1067 return;
1068 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1068 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1069 } 1069 }
1070 1070
1071 } // namespace content 1071 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698