OLD | NEW |
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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 #endif | 102 #endif |
103 | 103 |
104 namespace content { | 104 namespace content { |
105 | 105 |
106 typedef int32_t (*InitializeBrokerFunc) | 106 typedef int32_t (*InitializeBrokerFunc) |
107 (PP_ConnectInstance_Func* connect_instance_func); | 107 (PP_ConnectInstance_Func* connect_instance_func); |
108 | 108 |
109 PpapiThread::PpapiThread(const base::CommandLine& command_line, bool is_broker) | 109 PpapiThread::PpapiThread(const base::CommandLine& command_line, bool is_broker) |
110 : is_broker_(is_broker), | 110 : ChildThreadImpl(Options::Builder() |
| 111 .InitDiscardableMemory( |
| 112 !command_line.HasSwitch(switches::kSingleProcess)) |
| 113 .Build()), |
| 114 is_broker_(is_broker), |
111 plugin_globals_(GetIOTaskRunner()), | 115 plugin_globals_(GetIOTaskRunner()), |
112 connect_instance_func_(NULL), | 116 connect_instance_func_(NULL), |
113 local_pp_module_(base::RandInt(0, std::numeric_limits<PP_Module>::max())), | 117 local_pp_module_(base::RandInt(0, std::numeric_limits<PP_Module>::max())), |
114 next_plugin_dispatcher_id_(1) { | 118 next_plugin_dispatcher_id_(1) { |
115 plugin_globals_.SetPluginProxyDelegate(this); | 119 plugin_globals_.SetPluginProxyDelegate(this); |
116 plugin_globals_.set_command_line( | 120 plugin_globals_.set_command_line( |
117 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); | 121 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); |
118 | 122 |
119 blink_platform_impl_.reset(new PpapiBlinkPlatformImpl); | 123 blink_platform_impl_.reset(new PpapiBlinkPlatformImpl); |
120 blink::Platform::initialize(blink_platform_impl_.get()); | 124 blink::Platform::initialize(blink_platform_impl_.get()); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 GetHistogramName(is_broker_, "LoadTime", path), | 575 GetHistogramName(is_broker_, "LoadTime", path), |
572 base::TimeDelta::FromMilliseconds(1), | 576 base::TimeDelta::FromMilliseconds(1), |
573 base::TimeDelta::FromSeconds(10), | 577 base::TimeDelta::FromSeconds(10), |
574 50, | 578 50, |
575 base::HistogramBase::kUmaTargetedHistogramFlag); | 579 base::HistogramBase::kUmaTargetedHistogramFlag); |
576 | 580 |
577 histogram->AddTime(load_time); | 581 histogram->AddTime(load_time); |
578 } | 582 } |
579 | 583 |
580 } // namespace content | 584 } // namespace content |
OLD | NEW |