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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10949027: Close leaking FDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed last comments and synced. Created 8 years, 3 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
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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 #endif 129 #endif
130 130
131 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 131 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
132 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 132 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
133 #endif 133 #endif
134 134
135 #if defined(USE_NSS) 135 #if defined(USE_NSS)
136 #include "chrome/browser/ui/crypto_module_password_dialog.h" 136 #include "chrome/browser/ui/crypto_module_password_dialog.h"
137 #endif 137 #endif
138 138
139 using base::FileDescriptor;
139 using content::AccessTokenStore; 140 using content::AccessTokenStore;
140 using content::BrowserThread; 141 using content::BrowserThread;
141 using content::BrowserURLHandler; 142 using content::BrowserURLHandler;
142 using content::ChildProcessSecurityPolicy; 143 using content::ChildProcessSecurityPolicy;
144 using content::FileDescriptorInfo;
143 using content::QuotaPermissionContext; 145 using content::QuotaPermissionContext;
144 using content::RenderViewHost; 146 using content::RenderViewHost;
145 using content::SiteInstance; 147 using content::SiteInstance;
146 using content::WebContents; 148 using content::WebContents;
147 using extensions::APIPermission; 149 using extensions::APIPermission;
148 using extensions::Extension; 150 using extensions::Extension;
149 using webkit_glue::WebPreferences; 151 using webkit_glue::WebPreferences;
150 152
151 namespace { 153 namespace {
152 154
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 } 1659 }
1658 1660
1659 bool ChromeContentBrowserClient::AllowPepperPrivateFileAPI() { 1661 bool ChromeContentBrowserClient::AllowPepperPrivateFileAPI() {
1660 return CommandLine::ForCurrentProcess()->HasSwitch( 1662 return CommandLine::ForCurrentProcess()->HasSwitch(
1661 switches::kPpapiFlashInProcess); 1663 switches::kPpapiFlashInProcess);
1662 } 1664 }
1663 1665
1664 #if defined(OS_POSIX) && !defined(OS_MACOSX) 1666 #if defined(OS_POSIX) && !defined(OS_MACOSX)
1665 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 1667 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
1666 const CommandLine& command_line, 1668 const CommandLine& command_line,
1667 base::GlobalDescriptors::Mapping* mappings) { 1669 std::vector<FileDescriptorInfo>* mappings) {
1668 int crash_signal_fd = GetCrashSignalFD(command_line); 1670 int crash_signal_fd = GetCrashSignalFD(command_line);
1669 if (crash_signal_fd >= 0) { 1671 if (crash_signal_fd >= 0) {
1670 mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( 1672 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal,
1671 kCrashDumpSignal, crash_signal_fd)); 1673 FileDescriptor(crash_signal_fd,
1674 false)));
1672 } 1675 }
1673 } 1676 }
1674 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 1677 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
1675 1678
1676 #if defined(OS_WIN) 1679 #if defined(OS_WIN)
1677 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { 1680 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() {
1678 return chrome::kBrowserResourcesDll; 1681 return chrome::kBrowserResourcesDll;
1679 } 1682 }
1680 #endif 1683 #endif
1681 1684
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 partition_id = extension->id(); 1729 partition_id = extension->id();
1727 } 1730 }
1728 1731
1729 // Enforce that IsValidStoragePartitionId() implementation stays in sync. 1732 // Enforce that IsValidStoragePartitionId() implementation stays in sync.
1730 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); 1733 DCHECK(IsValidStoragePartitionId(browser_context, partition_id));
1731 return partition_id; 1734 return partition_id;
1732 } 1735 }
1733 1736
1734 1737
1735 } // namespace chrome 1738 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/app/android/sandboxed_process_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698