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

Side by Side Diff: mojo/shell/shell_test_helper.cc

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 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 | Annotate | Revision Log
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/shell/shell_test_helper.h" 5 #include "mojo/shell/shell_test_helper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "mojo/shell/context.h" 10 #include "mojo/shell/context.h"
(...skipping 22 matching lines...) Expand all
33 33
34 } // namespace 34 } // namespace
35 35
36 class ShellTestHelper::TestShellClient : public ShellClient { 36 class ShellTestHelper::TestShellClient : public ShellClient {
37 public: 37 public:
38 TestShellClient() {} 38 TestShellClient() {}
39 virtual ~TestShellClient() {} 39 virtual ~TestShellClient() {}
40 40
41 // ShellClient: 41 // ShellClient:
42 virtual void AcceptConnection( 42 virtual void AcceptConnection(
43 const mojo::String& url, 43 String url, ScopedMessagePipeHandle client_handle) OVERRIDE {
44 ScopedMessagePipeHandle client_handle) OVERRIDE {
45 } 44 }
46 45
47 private: 46 private:
48 DISALLOW_COPY_AND_ASSIGN(TestShellClient); 47 DISALLOW_COPY_AND_ASSIGN(TestShellClient);
49 }; 48 };
50 49
51 ShellTestHelper::ShellTestHelper() 50 ShellTestHelper::ShellTestHelper()
52 : shell_thread_("shell_test_helper"), 51 : shell_thread_("shell_test_helper"),
53 state_(NULL) { 52 state_(NULL) {
54 CommandLine::Init(0, NULL); 53 CommandLine::Init(0, NULL);
(...skipping 24 matching lines...) Expand all
79 void ShellTestHelper::OnShellStarted() { 78 void ShellTestHelper::OnShellStarted() {
80 DCHECK(state_); 79 DCHECK(state_);
81 shell_client_.reset(new TestShellClient); 80 shell_client_.reset(new TestShellClient);
82 shell_.Bind(state_->shell_handle.Pass()); 81 shell_.Bind(state_->shell_handle.Pass());
83 shell_->SetClient(shell_client_.get()); 82 shell_->SetClient(shell_client_.get());
84 run_loop_->Quit(); 83 run_loop_->Quit();
85 } 84 }
86 85
87 } // namespace shell 86 } // namespace shell
88 } // namespace mojo 87 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698