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

Side by Side Diff: content/browser/mojo/mojo_application_host.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some review comments Created 5 years, 2 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/mojo/mojo_application_host.h" 5 #include "content/browser/mojo/mojo_application_host.h"
6 6
7 #include "content/common/mojo/mojo_messages.h" 7 #include "content/common/mojo/mojo_messages.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "ipc/ipc_sender.h" 9 #include "ipc/ipc_sender.h"
10 #include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h" 10 #include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 service_registry_android_.reset( 53 service_registry_android_.reset(
54 new ServiceRegistryAndroid(&service_registry_)); 54 new ServiceRegistryAndroid(&service_registry_));
55 #endif 55 #endif
56 } 56 }
57 57
58 MojoApplicationHost::~MojoApplicationHost() { 58 MojoApplicationHost::~MojoApplicationHost() {
59 } 59 }
60 60
61 bool MojoApplicationHost::Init() { 61 bool MojoApplicationHost::Init() {
62 DCHECK(!client_handle_.is_valid()) << "Already initialized!"; 62 DCHECK(!client_handle_.is_valid()) << "Already initialized!";
63
64 mojo::embedder::PlatformChannelPair channel_pair; 63 mojo::embedder::PlatformChannelPair channel_pair;
65 64
66 scoped_refptr<base::TaskRunner> io_task_runner; 65 scoped_refptr<base::TaskRunner> io_task_runner;
67 if (io_task_runner_override_) { 66 if (io_task_runner_override_) {
68 io_task_runner = io_task_runner_override_; 67 io_task_runner = io_task_runner_override_;
69 } else { 68 } else {
70 io_task_runner = 69 io_task_runner =
71 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) 70 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO)
72 ->task_runner(); 71 ->task_runner();
73 } 72 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 DCHECK_CURRENTLY_ON(BrowserThread::IO); 105 DCHECK_CURRENTLY_ON(BrowserThread::IO);
107 channel_init_.ShutdownOnIOThread(); 106 channel_init_.ShutdownOnIOThread();
108 } 107 }
109 108
110 void MojoApplicationHost::OverrideIOTaskRunnerForTest( 109 void MojoApplicationHost::OverrideIOTaskRunnerForTest(
111 scoped_refptr<base::TaskRunner> io_task_runner) { 110 scoped_refptr<base::TaskRunner> io_task_runner) {
112 io_task_runner_override_ = io_task_runner; 111 io_task_runner_override_ = io_task_runner;
113 } 112 }
114 113
115 } // namespace content 114 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698