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

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

Issue 2485623002: discardable_memory: Using mojo IPC to replace Chrome IPC (Closed)
Patch Set: Fix build bots. Created 4 years 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 30 matching lines...) Expand all
41 #include "ipc/ipc_sync_channel.h" 41 #include "ipc/ipc_sync_channel.h"
42 #include "ipc/ipc_sync_message_filter.h" 42 #include "ipc/ipc_sync_message_filter.h"
43 #include "ppapi/c/dev/ppp_network_state_dev.h" 43 #include "ppapi/c/dev/ppp_network_state_dev.h"
44 #include "ppapi/c/pp_errors.h" 44 #include "ppapi/c/pp_errors.h"
45 #include "ppapi/c/ppp.h" 45 #include "ppapi/c/ppp.h"
46 #include "ppapi/proxy/interface_list.h" 46 #include "ppapi/proxy/interface_list.h"
47 #include "ppapi/proxy/plugin_globals.h" 47 #include "ppapi/proxy/plugin_globals.h"
48 #include "ppapi/proxy/plugin_message_filter.h" 48 #include "ppapi/proxy/plugin_message_filter.h"
49 #include "ppapi/proxy/ppapi_messages.h" 49 #include "ppapi/proxy/ppapi_messages.h"
50 #include "ppapi/proxy/resource_reply_thread_registrar.h" 50 #include "ppapi/proxy/resource_reply_thread_registrar.h"
51 #include "services/service_manager/public/cpp/interface_provider.h"
51 #include "third_party/WebKit/public/web/WebKit.h" 52 #include "third_party/WebKit/public/web/WebKit.h"
52 #include "ui/base/ui_base_switches.h" 53 #include "ui/base/ui_base_switches.h"
53 54
54 #if defined(OS_WIN) 55 #if defined(OS_WIN)
55 #include "base/win/win_util.h" 56 #include "base/win/win_util.h"
56 #include "base/win/windows_version.h" 57 #include "base/win/windows_version.h"
57 #include "content/child/font_warmup_win.h" 58 #include "content/child/font_warmup_win.h"
58 #include "sandbox/win/src/sandbox.h" 59 #include "sandbox/win/src/sandbox.h"
59 #elif defined(OS_MACOSX) 60 #elif defined(OS_MACOSX)
60 #include "content/common/sandbox_init_mac.h" 61 #include "content/common/sandbox_init_mac.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 scoped_refptr<ppapi::proxy::PluginMessageFilter> plugin_filter( 124 scoped_refptr<ppapi::proxy::PluginMessageFilter> plugin_filter(
124 new ppapi::proxy::PluginMessageFilter( 125 new ppapi::proxy::PluginMessageFilter(
125 NULL, plugin_globals_.resource_reply_thread_registrar())); 126 NULL, plugin_globals_.resource_reply_thread_registrar()));
126 channel()->AddFilter(plugin_filter.get()); 127 channel()->AddFilter(plugin_filter.get());
127 plugin_globals_.RegisterResourceMessageFilters(plugin_filter.get()); 128 plugin_globals_.RegisterResourceMessageFilters(plugin_filter.get());
128 } 129 }
129 130
130 // In single process, browser main loop set up the discardable memory 131 // In single process, browser main loop set up the discardable memory
131 // allocator. 132 // allocator.
132 if (!command_line.HasSwitch(switches::kSingleProcess)) { 133 if (!command_line.HasSwitch(switches::kSingleProcess)) {
134 discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
135 ChildThread::Get()->GetRemoteInterfaces()->GetInterface(
136 mojo::GetProxy(&manager_ptr));
137 discardable_shared_memory_manager_ = base::MakeUnique<
138 discardable_memory::ClientDiscardableSharedMemoryManager>(
139 manager_ptr.PassInterface(), GetIOTaskRunner().get());
dcheng 2016/11/25 00:07:08 Nit: the fact that we end up rebinding this interf
Peng 2016/11/25 16:41:53 Done.
133 base::DiscardableMemoryAllocator::SetInstance( 140 base::DiscardableMemoryAllocator::SetInstance(
134 ChildThreadImpl::discardable_shared_memory_manager()); 141 discardable_shared_memory_manager_.get());
135 } 142 }
136 } 143 }
137 144
138 PpapiThread::~PpapiThread() { 145 PpapiThread::~PpapiThread() {
139 } 146 }
140 147
141 void PpapiThread::Shutdown() { 148 void PpapiThread::Shutdown() {
142 ChildThreadImpl::Shutdown(); 149 ChildThreadImpl::Shutdown();
143 150
144 ppapi::proxy::PluginGlobals::Get()->ResetPluginProxyDelegate(); 151 ppapi::proxy::PluginGlobals::Get()->ResetPluginProxyDelegate();
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 GetHistogramName(is_broker_, "LoadTime", path), 578 GetHistogramName(is_broker_, "LoadTime", path),
572 base::TimeDelta::FromMilliseconds(1), 579 base::TimeDelta::FromMilliseconds(1),
573 base::TimeDelta::FromSeconds(10), 580 base::TimeDelta::FromSeconds(10),
574 50, 581 50,
575 base::HistogramBase::kUmaTargetedHistogramFlag); 582 base::HistogramBase::kUmaTargetedHistogramFlag);
576 583
577 histogram->AddTime(load_time); 584 histogram->AddTime(load_time);
578 } 585 }
579 586
580 } // namespace content 587 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698