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/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 blink::WebPlatformEventType type, | 1159 blink::WebPlatformEventType type, |
1160 scoped_ptr<PlatformEventObserverBase> observer) { | 1160 scoped_ptr<PlatformEventObserverBase> observer) { |
1161 if (platform_event_observers_.Lookup(type)) | 1161 if (platform_event_observers_.Lookup(type)) |
1162 platform_event_observers_.Remove(type); | 1162 platform_event_observers_.Remove(type); |
1163 platform_event_observers_.AddWithID(observer.release(), type); | 1163 platform_event_observers_.AddWithID(observer.release(), type); |
1164 } | 1164 } |
1165 | 1165 |
1166 void RendererBlinkPlatformImpl::connectToRemoteService( | 1166 void RendererBlinkPlatformImpl::connectToRemoteService( |
1167 const char* name, | 1167 const char* name, |
1168 mojo::ScopedMessagePipeHandle handle) { | 1168 mojo::ScopedMessagePipeHandle handle) { |
1169 // In the layout test mode, mock services should be used instead. | |
1170 // TODO(yukishiino): We'd like to inject mock services implemented in | |
1171 // JavaScript. Remove the following hack once we support JS-bindings | |
1172 // of Mojo and service mocking in JS. | |
1173 if (RenderThreadImpl::current() && | |
1174 RenderThreadImpl::current()->layout_test_mode()) | |
1175 return; | |
1176 | |
1177 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( | 1169 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( |
1178 name, std::move(handle)); | 1170 name, std::move(handle)); |
1179 } | 1171 } |
1180 | 1172 |
1181 void RendererBlinkPlatformImpl::startListening( | 1173 void RendererBlinkPlatformImpl::startListening( |
1182 blink::WebPlatformEventType type, | 1174 blink::WebPlatformEventType type, |
1183 blink::WebPlatformEventListener* listener) { | 1175 blink::WebPlatformEventListener* listener) { |
1184 PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type); | 1176 PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type); |
1185 if (!observer) { | 1177 if (!observer) { |
1186 observer = CreatePlatformEventObserverFromType(type); | 1178 observer = CreatePlatformEventObserverFromType(type); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 } | 1255 } |
1264 | 1256 |
1265 //------------------------------------------------------------------------------ | 1257 //------------------------------------------------------------------------------ |
1266 | 1258 |
1267 blink::WebTrialTokenValidator* | 1259 blink::WebTrialTokenValidator* |
1268 RendererBlinkPlatformImpl::trialTokenValidator() { | 1260 RendererBlinkPlatformImpl::trialTokenValidator() { |
1269 return &trial_token_validator_; | 1261 return &trial_token_validator_; |
1270 } | 1262 } |
1271 | 1263 |
1272 } // namespace content | 1264 } // namespace content |
OLD | NEW |