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

Side by Side Diff: mojo/spy/spy.cc

Issue 668663006: Standardize usage of virtual/override/final in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « mojo/shell/ui_application_loader_android.h ('k') | mojo/spy/spy_server_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "mojo/spy/spy.h" 5 #include "mojo/spy/spy.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 explicit SpyInterceptor( 232 explicit SpyInterceptor(
233 scoped_refptr<mojo::SpyServerImpl> spy_server, 233 scoped_refptr<mojo::SpyServerImpl> spy_server,
234 const scoped_refptr<base::MessageLoopProxy>& control_loop_proxy, 234 const scoped_refptr<base::MessageLoopProxy>& control_loop_proxy,
235 mojo::Spy::WebSocketDelegate* websocket_delegate) 235 mojo::Spy::WebSocketDelegate* websocket_delegate)
236 : spy_server_(spy_server), 236 : spy_server_(spy_server),
237 proxy_(base::MessageLoopProxy::current()), 237 proxy_(base::MessageLoopProxy::current()),
238 control_loop_proxy_(control_loop_proxy), 238 control_loop_proxy_(control_loop_proxy),
239 websocket_delegate_(websocket_delegate) {} 239 websocket_delegate_(websocket_delegate) {}
240 240
241 private: 241 private:
242 virtual mojo::ServiceProviderPtr OnConnectToClient( 242 mojo::ServiceProviderPtr OnConnectToClient(
243 const GURL& url, mojo::ServiceProviderPtr real_client) override { 243 const GURL& url,
244 mojo::ServiceProviderPtr real_client) override {
244 if (!MustIntercept(url)) 245 if (!MustIntercept(url))
245 return real_client.Pass(); 246 return real_client.Pass();
246 247
247 // You can get an invalid handle if the app (or service) is 248 // You can get an invalid handle if the app (or service) is
248 // created by unconventional means, for example the command line. 249 // created by unconventional means, for example the command line.
249 if (!real_client) 250 if (!real_client)
250 return real_client.Pass(); 251 return real_client.Pass();
251 252
252 mojo::ScopedMessagePipeHandle faux_client; 253 mojo::ScopedMessagePipeHandle faux_client;
253 mojo::ScopedMessagePipeHandle interceptor; 254 mojo::ScopedMessagePipeHandle interceptor;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 base::Bind(&WebSocketDelegate::Start, 341 base::Bind(&WebSocketDelegate::Start,
341 base::Unretained(websocket_delegate_), 342 base::Unretained(websocket_delegate_),
342 spy_options_->websocket_port, 343 spy_options_->websocket_port,
343 base::Passed(spy_server_->ServerPipe()))); 344 base::Passed(spy_server_->ServerPipe())));
344 // Start intercepting mojo services. 345 // Start intercepting mojo services.
345 application_manager_->SetInterceptor(new SpyInterceptor( 346 application_manager_->SetInterceptor(new SpyInterceptor(
346 spy_server_, control_thread_->message_loop_proxy(), websocket_delegate_)); 347 spy_server_, control_thread_->message_loop_proxy(), websocket_delegate_));
347 } 348 }
348 349
349 } // namespace mojo 350 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/ui_application_loader_android.h ('k') | mojo/spy/spy_server_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698