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

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 bot issues 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 scoped_refptr<ppapi::proxy::PluginMessageFilter> plugin_filter( 125 scoped_refptr<ppapi::proxy::PluginMessageFilter> plugin_filter(
125 new ppapi::proxy::PluginMessageFilter( 126 new ppapi::proxy::PluginMessageFilter(
126 NULL, plugin_globals_.resource_reply_thread_registrar())); 127 NULL, plugin_globals_.resource_reply_thread_registrar()));
127 channel()->AddFilter(plugin_filter.get()); 128 channel()->AddFilter(plugin_filter.get());
128 plugin_globals_.RegisterResourceMessageFilters(plugin_filter.get()); 129 plugin_globals_.RegisterResourceMessageFilters(plugin_filter.get());
129 } 130 }
130 131
131 // In single process, browser main loop set up the discardable memory 132 // In single process, browser main loop set up the discardable memory
132 // allocator. 133 // allocator.
133 if (!command_line.HasSwitch(switches::kSingleProcess)) { 134 if (!command_line.HasSwitch(switches::kSingleProcess)) {
135 discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
136 ChildThread::Get()->GetRemoteInterfaces()->GetInterface(
137 mojo::GetProxy(&manager_ptr));
138 discardable_shared_memory_manager_ = base::MakeUnique<
139 discardable_memory::ClientDiscardableSharedMemoryManager>(
140 std::move(manager_ptr), GetIOTaskRunner());
134 base::DiscardableMemoryAllocator::SetInstance( 141 base::DiscardableMemoryAllocator::SetInstance(
135 ChildThreadImpl::discardable_shared_memory_manager()); 142 discardable_shared_memory_manager_.get());
136 } 143 }
137 field_trial_syncer_.InitFieldTrialObserving(command_line, 144 field_trial_syncer_.InitFieldTrialObserving(command_line,
138 switches::kSingleProcess); 145 switches::kSingleProcess);
139 } 146 }
140 147
141 PpapiThread::~PpapiThread() { 148 PpapiThread::~PpapiThread() {
142 } 149 }
143 150
144 void PpapiThread::Shutdown() { 151 void PpapiThread::Shutdown() {
145 ChildThreadImpl::Shutdown(); 152 ChildThreadImpl::Shutdown();
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 GetHistogramName(is_broker_, "LoadTime", path), 587 GetHistogramName(is_broker_, "LoadTime", path),
581 base::TimeDelta::FromMilliseconds(1), 588 base::TimeDelta::FromMilliseconds(1),
582 base::TimeDelta::FromSeconds(10), 589 base::TimeDelta::FromSeconds(10),
583 50, 590 50,
584 base::HistogramBase::kUmaTargetedHistogramFlag); 591 base::HistogramBase::kUmaTargetedHistogramFlag);
585 592
586 histogram->AddTime(load_time); 593 histogram->AddTime(load_time);
587 } 594 }
588 595
589 } // namespace content 596 } // namespace content
OLDNEW
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.h ('k') | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698