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

Side by Side Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 2485623002: discardable_memory: Using mojo IPC to replace Chrome IPC (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 "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
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))
reveman 2016/11/18 21:55:26 sorry if I asked this already but would it be poss
Peng 2016/11/21 15:56:39 Done
Peng 2016/11/21 18:31:42 Sorry. I just tried it. But the content_browsertes
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698