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

Side by Side Diff: content/shell/shell_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
« no previous file with comments | « content/shell/shell_content_browser_client.h ('k') | no next file » | 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/shell/shell_content_browser_client.h" 5 #include "content/shell/shell_content_browser_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "content/public/browser/resource_dispatcher_host.h" 9 #include "content/public/browser/resource_dispatcher_host.h"
10 #include "content/shell/geolocation/shell_access_token_store.h" 10 #include "content/shell/geolocation/shell_access_token_store.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #if defined(TOOLKIT_GTK) || defined(OS_WIN) || defined(OS_MACOSX) 69 #if defined(TOOLKIT_GTK) || defined(OS_WIN) || defined(OS_MACOSX)
70 return CreateShellWebContentsViewDelegate(web_contents); 70 return CreateShellWebContentsViewDelegate(web_contents);
71 #endif 71 #endif
72 NOTIMPLEMENTED(); 72 NOTIMPLEMENTED();
73 return NULL; 73 return NULL;
74 } 74 }
75 75
76 #if defined(OS_ANDROID) 76 #if defined(OS_ANDROID)
77 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 77 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
78 const CommandLine& command_line, 78 const CommandLine& command_line,
79 base::GlobalDescriptors::Mapping* mappings) { 79 std::vector<content::FileDescriptorInfo>* mappings) {
80 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; 80 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
81 FilePath pak_file; 81 FilePath pak_file;
82 DCHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file)); 82 DCHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file));
83 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); 83 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks"));
84 pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak")); 84 pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak"));
85 85
86 base::PlatformFile f = 86 base::PlatformFile f =
87 base::CreatePlatformFile(pak_file, flags, NULL, NULL); 87 base::CreatePlatformFile(pak_file, flags, NULL, NULL);
88 if (f == base::kInvalidPlatformFileValue) { 88 if (f == base::kInvalidPlatformFileValue) {
89 NOTREACHED() << "Failed to open file when creating renderer process: " 89 NOTREACHED() << "Failed to open file when creating renderer process: "
90 << "content_shell.pak"; 90 << "content_shell.pak";
91 } 91 }
92 mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( 92 mappings->push_back(
93 kShellPakDescriptor, f)); 93 content::FileDescriptorInfo(kShellPakDescriptor,
94 base::FileDescriptor(f, true)));
94 } 95 }
95 #endif 96 #endif
96 97
97 ShellBrowserContext* ShellContentBrowserClient::browser_context() { 98 ShellBrowserContext* ShellContentBrowserClient::browser_context() {
98 return shell_browser_main_parts_->browser_context(); 99 return shell_browser_main_parts_->browser_context();
99 } 100 }
100 101
101 ShellBrowserContext* 102 ShellBrowserContext*
102 ShellContentBrowserClient::off_the_record_browser_context() { 103 ShellContentBrowserClient::off_the_record_browser_context() {
103 return shell_browser_main_parts_->off_the_record_browser_context(); 104 return shell_browser_main_parts_->off_the_record_browser_context();
104 } 105 }
105 106
106 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { 107 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() {
107 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); 108 return new ShellAccessTokenStore(browser_context()->GetRequestContext());
108 } 109 }
109 110
110 } // namespace content 111 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell_content_browser_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698