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

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

Issue 1011133006: Move V8 snapshot loading code from isolate_holder to gin/v8_startup_data.{h,cc}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing #ifdef in V8Initializer::Initialize. Created 5 years, 8 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/DEPS ('k') | chrome/plugin/DEPS » ('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 "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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "content/public/browser/render_frame_host.h" 110 #include "content/public/browser/render_frame_host.h"
111 #include "content/public/browser/render_process_host.h" 111 #include "content/public/browser/render_process_host.h"
112 #include "content/public/browser/render_view_host.h" 112 #include "content/public/browser/render_view_host.h"
113 #include "content/public/browser/resource_context.h" 113 #include "content/public/browser/resource_context.h"
114 #include "content/public/browser/site_instance.h" 114 #include "content/public/browser/site_instance.h"
115 #include "content/public/browser/web_contents.h" 115 #include "content/public/browser/web_contents.h"
116 #include "content/public/common/child_process_host.h" 116 #include "content/public/common/child_process_host.h"
117 #include "content/public/common/content_descriptors.h" 117 #include "content/public/common/content_descriptors.h"
118 #include "content/public/common/url_utils.h" 118 #include "content/public/common/url_utils.h"
119 #include "content/public/common/web_preferences.h" 119 #include "content/public/common/web_preferences.h"
120 #include "gin/public/isolate_holder.h" 120 #include "gin/v8_initializer.h"
121 #include "net/base/mime_util.h" 121 #include "net/base/mime_util.h"
122 #include "net/cookies/canonical_cookie.h" 122 #include "net/cookies/canonical_cookie.h"
123 #include "net/cookies/cookie_options.h" 123 #include "net/cookies/cookie_options.h"
124 #include "net/ssl/ssl_cert_request_info.h" 124 #include "net/ssl/ssl_cert_request_info.h"
125 #include "ppapi/host/ppapi_host.h" 125 #include "ppapi/host/ppapi_host.h"
126 #include "storage/browser/fileapi/external_mount_points.h" 126 #include "storage/browser/fileapi/external_mount_points.h"
127 #include "ui/base/l10n/l10n_util.h" 127 #include "ui/base/l10n/l10n_util.h"
128 #include "ui/base/resource/resource_bundle.h" 128 #include "ui/base/resource/resource_bundle.h"
129 #include "ui/resources/grit/ui_resources.h" 129 #include "ui/resources/grit/ui_resources.h"
130 130
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 } 2178 }
2179 2179
2180 #if defined(OS_POSIX) && !defined(OS_MACOSX) 2180 #if defined(OS_POSIX) && !defined(OS_MACOSX)
2181 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 2181 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
2182 const base::CommandLine& command_line, 2182 const base::CommandLine& command_line,
2183 int child_process_id, 2183 int child_process_id,
2184 FileDescriptorInfo* mappings) { 2184 FileDescriptorInfo* mappings) {
2185 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 2185 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
2186 if (v8_snapshot_fd_.get() == -1 && v8_natives_fd_.get() == -1) { 2186 if (v8_snapshot_fd_.get() == -1 && v8_natives_fd_.get() == -1) {
2187 base::FilePath v8_data_path; 2187 base::FilePath v8_data_path;
2188 PathService::Get(gin::IsolateHolder::kV8SnapshotBasePathKey, &v8_data_path); 2188 PathService::Get(gin::V8Initializer::kV8SnapshotBasePathKey, &v8_data_path);
2189 DCHECK(!v8_data_path.empty()); 2189 DCHECK(!v8_data_path.empty());
2190 2190
2191 int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ; 2191 int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2192 base::FilePath v8_natives_data_path = 2192 base::FilePath v8_natives_data_path =
2193 v8_data_path.AppendASCII(gin::IsolateHolder::kNativesFileName); 2193 v8_data_path.AppendASCII(gin::V8Initializer::kNativesFileName);
2194 base::FilePath v8_snapshot_data_path = 2194 base::FilePath v8_snapshot_data_path =
2195 v8_data_path.AppendASCII(gin::IsolateHolder::kSnapshotFileName); 2195 v8_data_path.AppendASCII(gin::V8Initializer::kSnapshotFileName);
2196 base::File v8_natives_data_file(v8_natives_data_path, file_flags); 2196 base::File v8_natives_data_file(v8_natives_data_path, file_flags);
2197 base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags); 2197 base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
2198 DCHECK(v8_natives_data_file.IsValid()); 2198 DCHECK(v8_natives_data_file.IsValid());
2199 DCHECK(v8_snapshot_data_file.IsValid()); 2199 DCHECK(v8_snapshot_data_file.IsValid());
2200 v8_natives_fd_.reset(v8_natives_data_file.TakePlatformFile()); 2200 v8_natives_fd_.reset(v8_natives_data_file.TakePlatformFile());
2201 v8_snapshot_fd_.reset(v8_snapshot_data_file.TakePlatformFile()); 2201 v8_snapshot_fd_.reset(v8_snapshot_data_file.TakePlatformFile());
2202 } 2202 }
2203 mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get()); 2203 mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
2204 mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get()); 2204 mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
2205 #endif // V8_USE_EXTERNAL_STARTUP_DATA 2205 #endif // V8_USE_EXTERNAL_STARTUP_DATA
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2414 switches::kDisableWebRtcEncryption, 2414 switches::kDisableWebRtcEncryption,
2415 }; 2415 };
2416 to_command_line->CopySwitchesFrom(from_command_line, 2416 to_command_line->CopySwitchesFrom(from_command_line,
2417 kWebRtcDevSwitchNames, 2417 kWebRtcDevSwitchNames,
2418 arraysize(kWebRtcDevSwitchNames)); 2418 arraysize(kWebRtcDevSwitchNames));
2419 } 2419 }
2420 } 2420 }
2421 #endif // defined(ENABLE_WEBRTC) 2421 #endif // defined(ENABLE_WEBRTC)
2422 2422
2423 } // namespace chrome 2423 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/plugin/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698