Don't preload rarely seen large images
[chromium-blink-merge.git] / components / nacl / common / nacl_types.cc
blob1273ec638127754903d732e0fce2d5b3264cebf6
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/nacl/common/nacl_types.h"
6 #include "ipc/ipc_platform_file.h"
8 namespace nacl {
10 NaClStartParams::NaClStartParams()
11 : nexe_file(IPC::InvalidPlatformFileForTransit()),
12 imc_bootstrap_handle(IPC::InvalidPlatformFileForTransit()),
13 irt_handle(IPC::InvalidPlatformFileForTransit()),
14 #if defined(OS_MACOSX)
15 mac_shm_fd(IPC::InvalidPlatformFileForTransit()),
16 #endif
17 #if defined(OS_POSIX)
18 debug_stub_server_bound_socket(IPC::InvalidPlatformFileForTransit()),
19 #endif
20 validation_cache_enabled(false),
21 enable_debug_stub(false),
22 enable_ipc_proxy(false),
23 process_type(kUnknownNaClProcessType),
24 crash_info_shmem_handle(base::SharedMemory::NULLHandle()) {
27 NaClStartParams::~NaClStartParams() {
30 NaClResourcePrefetchResult::NaClResourcePrefetchResult()
31 : file(IPC::InvalidPlatformFileForTransit()) {
34 NaClResourcePrefetchResult::NaClResourcePrefetchResult(
35 const IPC::PlatformFileForTransit& file,
36 const base::FilePath& file_path_metadata,
37 const std::string& file_key)
38 : file(file), file_path_metadata(file_path_metadata), file_key(file_key) {
41 NaClResourcePrefetchResult::~NaClResourcePrefetchResult() {
44 NaClResourcePrefetchRequest::NaClResourcePrefetchRequest() {
47 NaClResourcePrefetchRequest::NaClResourcePrefetchRequest(
48 const std::string& file_key,
49 const std::string& resource_url)
50 : file_key(file_key),
51 resource_url(resource_url) {
54 NaClResourcePrefetchRequest::~NaClResourcePrefetchRequest() {
57 NaClLaunchParams::NaClLaunchParams()
58 : nexe_file(IPC::InvalidPlatformFileForTransit()),
59 nexe_token_lo(0),
60 nexe_token_hi(0),
61 render_view_id(0),
62 permission_bits(0),
63 process_type(kUnknownNaClProcessType) {
66 NaClLaunchParams::NaClLaunchParams(
67 const std::string& manifest_url,
68 const IPC::PlatformFileForTransit& nexe_file,
69 uint64_t nexe_token_lo,
70 uint64_t nexe_token_hi,
71 const std::vector<
72 NaClResourcePrefetchRequest>& resource_prefetch_request_list,
73 int render_view_id,
74 uint32 permission_bits,
75 bool uses_nonsfi_mode,
76 NaClAppProcessType process_type)
77 : manifest_url(manifest_url),
78 nexe_file(nexe_file),
79 nexe_token_lo(nexe_token_lo),
80 nexe_token_hi(nexe_token_hi),
81 resource_prefetch_request_list(resource_prefetch_request_list),
82 render_view_id(render_view_id),
83 permission_bits(permission_bits),
84 uses_nonsfi_mode(uses_nonsfi_mode),
85 process_type(process_type) {
88 NaClLaunchParams::~NaClLaunchParams() {
91 NaClLaunchResult::NaClLaunchResult()
92 : imc_channel_handle(IPC::InvalidPlatformFileForTransit()),
93 ppapi_ipc_channel_handle(),
94 trusted_ipc_channel_handle(),
95 plugin_pid(base::kNullProcessId),
96 plugin_child_id(0),
97 crash_info_shmem_handle(base::SharedMemory::NULLHandle()) {
100 NaClLaunchResult::NaClLaunchResult(
101 const IPC::PlatformFileForTransit& imc_channel_handle,
102 const IPC::ChannelHandle& ppapi_ipc_channel_handle,
103 const IPC::ChannelHandle& trusted_ipc_channel_handle,
104 const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
105 base::ProcessId plugin_pid,
106 int plugin_child_id,
107 base::SharedMemoryHandle crash_info_shmem_handle)
108 : imc_channel_handle(imc_channel_handle),
109 ppapi_ipc_channel_handle(ppapi_ipc_channel_handle),
110 trusted_ipc_channel_handle(trusted_ipc_channel_handle),
111 manifest_service_ipc_channel_handle(manifest_service_ipc_channel_handle),
112 plugin_pid(plugin_pid),
113 plugin_child_id(plugin_child_id),
114 crash_info_shmem_handle(crash_info_shmem_handle) {
117 NaClLaunchResult::~NaClLaunchResult() {
120 } // namespace nacl