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

Side by Side Diff: content/shell/app/shell_main_delegate.cc

Issue 402603006: [android_webview] Do not extract webviewchromium.pak (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@awassets
Patch Set: Use only InitSharedInstanceWithPakFileRegion and + rebase Created 6 years, 4 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/app/chrome_main_delegate.cc ('k') | ui/base/resource/resource_bundle.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) 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/app/shell_main_delegate.h" 5 #include "content/shell/app/shell_main_delegate.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 void ShellMainDelegate::InitializeResourceBundle() { 258 void ShellMainDelegate::InitializeResourceBundle() {
259 #if defined(OS_ANDROID) 259 #if defined(OS_ANDROID)
260 // In the Android case, the renderer runs with a different UID and can never 260 // In the Android case, the renderer runs with a different UID and can never
261 // access the file system. So we are passed a file descriptor to the 261 // access the file system. So we are passed a file descriptor to the
262 // ResourceBundle pak at launch time. 262 // ResourceBundle pak at launch time.
263 int pak_fd = 263 int pak_fd =
264 base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor); 264 base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor);
265 if (pak_fd >= 0) { 265 if (pak_fd >= 0) {
266 // This is clearly wrong. See crbug.com/330930 266 // This is clearly wrong. See crbug.com/330930
267 ui::ResourceBundle::InitSharedInstanceWithPakFile(base::File(pak_fd), 267 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
268 false); 268 base::File(pak_fd), base::MemoryMappedFile::Region::kWholeFile, false);
269 ResourceBundle::GetSharedInstance().AddDataPackFromFile( 269 ResourceBundle::GetSharedInstance().AddDataPackFromFile(
270 base::File(pak_fd), ui::SCALE_FACTOR_100P); 270 base::File(pak_fd), ui::SCALE_FACTOR_100P);
271 return; 271 return;
272 } 272 }
273 #endif 273 #endif
274 274
275 base::FilePath pak_file; 275 base::FilePath pak_file;
276 #if defined(OS_MACOSX) 276 #if defined(OS_MACOSX)
277 pak_file = GetResourcesPakFilePath(); 277 pak_file = GetResourcesPakFilePath();
278 #else 278 #else
(...skipping 16 matching lines...) Expand all
295 browser_client_.reset(new ShellContentBrowserClient); 295 browser_client_.reset(new ShellContentBrowserClient);
296 return browser_client_.get(); 296 return browser_client_.get();
297 } 297 }
298 298
299 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { 299 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() {
300 renderer_client_.reset(new ShellContentRendererClient); 300 renderer_client_.reset(new ShellContentRendererClient);
301 return renderer_client_.get(); 301 return renderer_client_.get();
302 } 302 }
303 303
304 } // namespace content 304 } // namespace content
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | ui/base/resource/resource_bundle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698