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

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

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Ross' comments 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 "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 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after
2481 DCHECK(!app_data_path.empty()); 2481 DCHECK(!app_data_path.empty());
2482 2482
2483 flags = base::File::FLAG_OPEN | base::File::FLAG_READ; 2483 flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2484 base::FilePath icudata_path = 2484 base::FilePath icudata_path =
2485 app_data_path.AppendASCII("icudtl.dat"); 2485 app_data_path.AppendASCII("icudtl.dat");
2486 base::File icudata_file(icudata_path, flags); 2486 base::File icudata_file(icudata_path, flags);
2487 DCHECK(icudata_file.IsValid()); 2487 DCHECK(icudata_file.IsValid());
2488 mappings->Transfer(kAndroidICUDataDescriptor, 2488 mappings->Transfer(kAndroidICUDataDescriptor,
2489 base::ScopedFD(icudata_file.TakePlatformFile())); 2489 base::ScopedFD(icudata_file.TakePlatformFile()));
2490 2490
2491 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
2492 base::FilePath v8_data_path;
2493 PathService::Get(base::DIR_ANDROID_APP_DATA, &v8_data_path);
2494 DCHECK(!v8_data_path.empty());
2495
2496 int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2497 base::FilePath v8_natives_data_path =
2498 v8_data_path.AppendASCII("natives_blob.bin");
2499 base::FilePath v8_snapshot_data_path =
2500 v8_data_path.AppendASCII("snapshot_blob.bin");
2501 base::File v8_natives_data_file(v8_natives_data_path, file_flags);
2502 base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
2503 DCHECK(v8_natives_data_file.IsValid());
2504 DCHECK(v8_snapshot_data_file.IsValid());
2505 mappings->Transfer(kV8NativesDataDescriptor,
2506 base::ScopedFD(v8_natives_data_file.TakePlatformFile()));
2507 mappings->Transfer(kV8SnapshotDataDescriptor,
2508 base::ScopedFD(v8_snapshot_data_file.TakePlatformFile()));
2509 #endif // V8_USE_EXTERNAL_STARTUP_DATA
2510
2491 #else 2511 #else
2492 int crash_signal_fd = GetCrashSignalFD(command_line); 2512 int crash_signal_fd = GetCrashSignalFD(command_line);
2493 if (crash_signal_fd >= 0) { 2513 if (crash_signal_fd >= 0) {
2494 mappings->Share(kCrashDumpSignal, crash_signal_fd); 2514 mappings->Share(kCrashDumpSignal, crash_signal_fd);
2495 } 2515 }
2496 #endif // defined(OS_ANDROID) 2516 #endif // defined(OS_ANDROID)
2497 } 2517 }
2498 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 2518 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
2499 2519
2500 #if defined(OS_WIN) 2520 #if defined(OS_WIN)
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 switches::kDisableWebRtcEncryption, 2654 switches::kDisableWebRtcEncryption,
2635 }; 2655 };
2636 to_command_line->CopySwitchesFrom(from_command_line, 2656 to_command_line->CopySwitchesFrom(from_command_line,
2637 kWebRtcDevSwitchNames, 2657 kWebRtcDevSwitchNames,
2638 arraysize(kWebRtcDevSwitchNames)); 2658 arraysize(kWebRtcDevSwitchNames));
2639 } 2659 }
2640 } 2660 }
2641 #endif // defined(ENABLE_WEBRTC) 2661 #endif // defined(ENABLE_WEBRTC)
2642 2662
2643 } // namespace chrome 2663 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698