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

Side by Side Diff: services/debugger/debugger.cc

Issue 1979723002: ApplicationConnection devolution, part 3. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 | « services/dart/content_handler_main.cc ('k') | services/device_info/device_info.cc » ('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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/profiler.h" 8 #include "base/debug/profiler.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 local_address->ipv4->port = command_port_; 62 local_address->ipv4->port = command_port_;
63 http_server_factory->CreateHttpServer(GetProxy(&http_server_).Pass(), 63 http_server_factory->CreateHttpServer(GetProxy(&http_server_).Pass(),
64 local_address.Pass()); 64 local_address.Pass());
65 65
66 http_server::HttpHandlerPtr handler_ptr; 66 http_server::HttpHandlerPtr handler_ptr;
67 handler_binding_.Bind(GetProxy(&handler_ptr).Pass()); 67 handler_binding_.Bind(GetProxy(&handler_ptr).Pass());
68 http_server_->SetHandler(".*", handler_ptr.Pass(), 68 http_server_->SetHandler(".*", handler_ptr.Pass(),
69 [](bool result) { DCHECK(result); }); 69 [](bool result) { DCHECK(result); });
70 } 70 }
71 71
72 bool ConfigureIncomingConnection(
73 mojo::ApplicationConnection* connection) override {
74 return true;
75 }
76
77 // http_server::HttpHandler: 72 // http_server::HttpHandler:
78 void HandleRequest(http_server::HttpRequestPtr request, 73 void HandleRequest(http_server::HttpRequestPtr request,
79 const HandleRequestCallback& callback) override { 74 const HandleRequestCallback& callback) override {
80 // FIXME: We should use use a fancier lookup system more like what 75 // FIXME: We should use use a fancier lookup system more like what
81 // services/http_server/http_server.cc does with AddHandler. 76 // services/http_server/http_server.cc does with AddHandler.
82 if (request->relative_url == "/quit") { 77 if (request->relative_url == "/quit") {
83 Exit(); 78 Exit();
84 } else if (request->relative_url == "/start_tracing") { 79 } else if (request->relative_url == "/start_tracing") {
85 StartTracing(callback); 80 StartTracing(callback);
86 } else if (request->relative_url == "/stop_tracing") { 81 } else if (request->relative_url == "/stop_tracing") {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 DISALLOW_COPY_AND_ASSIGN(Debugger); 158 DISALLOW_COPY_AND_ASSIGN(Debugger);
164 }; 159 };
165 160
166 } // namespace debugger 161 } // namespace debugger
167 162
168 MojoResult MojoMain(MojoHandle application_request) { 163 MojoResult MojoMain(MojoHandle application_request) {
169 mojo::ApplicationRunnerChromium runner(new debugger::Debugger); 164 mojo::ApplicationRunnerChromium runner(new debugger::Debugger);
170 runner.set_message_loop_type(base::MessageLoop::TYPE_IO); 165 runner.set_message_loop_type(base::MessageLoop::TYPE_IO);
171 return runner.Run(application_request); 166 return runner.Run(application_request);
172 } 167 }
OLDNEW
« no previous file with comments | « services/dart/content_handler_main.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698