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

Side by Side Diff: mojo/services/log/cpp/lib/log_client.cc

Issue 1660403003: Mojo C++ bindings: Rename InterfaceInfoPtr -> InterfaceHandle (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: using {{InterfaceName}}Handle = InterfaceHandle<{{InterfaceName}}> Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/services/log/cpp/log_client.h" 5 #include "mojo/services/log/cpp/log_client.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "mojo/public/c/environment/logger.h" 12 #include "mojo/public/c/environment/logger.h"
13 #include "mojo/public/cpp/bindings/interface_ptr_info.h" 13 #include "mojo/public/cpp/bindings/interface_handle.h"
14 #include "mojo/public/cpp/bindings/lib/message_builder.h" 14 #include "mojo/public/cpp/bindings/lib/message_builder.h"
15 #include "mojo/public/cpp/system/macros.h" 15 #include "mojo/public/cpp/system/macros.h"
16 #include "mojo/public/cpp/system/message_pipe.h" 16 #include "mojo/public/cpp/system/message_pipe.h"
17 #include "mojo/services/log/interfaces/entry.mojom.h" 17 #include "mojo/services/log/interfaces/entry.mojom.h"
18 #include "mojo/services/log/interfaces/log.mojom.h" 18 #include "mojo/services/log/interfaces/log.mojom.h"
19 19
20 namespace mojo { 20 namespace mojo {
21 namespace { 21 namespace {
22 22
23 class LogClient; 23 class LogClient;
(...skipping 17 matching lines...) Expand all
41 LogClient(log::LogPtr log_service, const MojoLogger* fallback_logger); 41 LogClient(log::LogPtr log_service, const MojoLogger* fallback_logger);
42 void LogMessage(MojoLogLevel log_level, 42 void LogMessage(MojoLogLevel log_level,
43 const char* source_file, 43 const char* source_file,
44 uint32_t source_line, 44 uint32_t source_line,
45 const char* message) const; 45 const char* message) const;
46 46
47 MojoLogLevel GetMinimumLogLevel() const; 47 MojoLogLevel GetMinimumLogLevel() const;
48 void SetMinimumLogLevel(MojoLogLevel level); 48 void SetMinimumLogLevel(MojoLogLevel level);
49 49
50 private: 50 private:
51 const InterfacePtrInfo<mojo::log::Log> log_interface_; 51 const InterfaceHandle<mojo::log::Log> log_interface_;
52 const MojoLogger* const fallback_logger_; 52 const MojoLogger* const fallback_logger_;
53 53
54 MOJO_DISALLOW_COPY_AND_ASSIGN(LogClient); 54 MOJO_DISALLOW_COPY_AND_ASSIGN(LogClient);
55 }; 55 };
56 56
57 LogClient::LogClient(log::LogPtr log, const MojoLogger* fallback_logger) 57 LogClient::LogClient(log::LogPtr log, const MojoLogger* fallback_logger)
58 : log_interface_(log.PassInterface()), fallback_logger_(fallback_logger) { 58 : log_interface_(log.PassInterface()), fallback_logger_(fallback_logger) {
59 assert(log_interface_.is_valid()); 59 assert(log_interface_.is_valid());
60 assert(fallback_logger_); 60 assert(fallback_logger_);
61 } 61 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 void DestroyLogger() { 163 void DestroyLogger() {
164 assert(g_log_client); 164 assert(g_log_client);
165 delete g_log_client; 165 delete g_log_client;
166 g_log_client = nullptr; 166 g_log_client = nullptr;
167 } 167 }
168 168
169 } // namespace log 169 } // namespace log
170 } // namespace mojo 170 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698