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

Side by Side Diff: chrome/common/ipc_message.cc

Issue 149062: mac/linux: rework plugin channel file descriptor creation (Closed)
Patch Set: address review comments Created 11 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
« no previous file with comments | « chrome/browser/plugin_process_host.cc ('k') | chrome/common/plugin_messages_internal.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/common/ipc_message.h" 5 #include "chrome/common/ipc_message.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_POSIX) 10 #if defined(OS_POSIX)
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 base::FileDescriptor* descriptor) const { 102 base::FileDescriptor* descriptor) const {
103 int descriptor_index; 103 int descriptor_index;
104 if (!ReadInt(iter, &descriptor_index)) 104 if (!ReadInt(iter, &descriptor_index))
105 return false; 105 return false;
106 106
107 FileDescriptorSet* file_descriptor_set = file_descriptor_set_.get(); 107 FileDescriptorSet* file_descriptor_set = file_descriptor_set_.get();
108 if (!file_descriptor_set) 108 if (!file_descriptor_set)
109 return false; 109 return false;
110 110
111 descriptor->fd = file_descriptor_set->GetDescriptorAt(descriptor_index); 111 descriptor->fd = file_descriptor_set->GetDescriptorAt(descriptor_index);
112 descriptor->auto_close = false; 112 descriptor->auto_close = true;
113 113
114 return descriptor->fd >= 0; 114 return descriptor->fd >= 0;
115 } 115 }
116 116
117 void Message::EnsureFileDescriptorSet() { 117 void Message::EnsureFileDescriptorSet() {
118 if (file_descriptor_set_.get() == NULL) 118 if (file_descriptor_set_.get() == NULL)
119 file_descriptor_set_ = new FileDescriptorSet; 119 file_descriptor_set_ = new FileDescriptorSet;
120 } 120 }
121 121
122 #endif 122 #endif
123 123
124 } // namespace IPC 124 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/browser/plugin_process_host.cc ('k') | chrome/common/plugin_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698