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

Side by Side Diff: third_party/libjingle/overrides/initialize_module.cc

Issue 17647002: Fix check_perms for r208246 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « third_party/libjingle/overrides/init_webrtc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "allocator_shim/allocator_stub.h" 5 #include "allocator_shim/allocator_stub.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "init_webrtc.h" 9 #include "init_webrtc.h"
10 #include "talk/base/basictypes.h" 10 #include "talk/base/basictypes.h"
11 #include "talk/media/webrtc/webrtcmediaengine.h" 11 #include "talk/media/webrtc/webrtcmediaengine.h"
12 12
13 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB) 13 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB)
14 #error "Only compile the allocator proxy with the shared_library implementation" 14 #error "Only compile the allocator proxy with the shared_library implementation"
15 #endif 15 #endif
16 16
17 #if defined(OS_WIN) 17 #if defined(OS_WIN)
18 #define ALLOC_EXPORT __declspec(dllexport) 18 #define ALLOC_EXPORT __declspec(dllexport)
19 #else 19 #else
20 #define ALLOC_EXPORT __attribute__((visibility("default"))) 20 #define ALLOC_EXPORT __attribute__((visibility("default")))
21 #endif 21 #endif
22 22
23 #if !defined(OS_MACOSX) 23 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
24 // These are used by our new/delete overrides in 24 // These are used by our new/delete overrides in
25 // allocator_shim/allocator_proxy.cc 25 // allocator_shim/allocator_proxy.cc
26 AllocateFunction g_alloc = NULL; 26 AllocateFunction g_alloc = NULL;
27 DellocateFunction g_dealloc = NULL; 27 DellocateFunction g_dealloc = NULL;
28 #endif 28 #endif
29 29
30 // Forward declare of the libjingle internal factory and destroy methods for the 30 // Forward declare of the libjingle internal factory and destroy methods for the
31 // WebRTC media engine. 31 // WebRTC media engine.
32 cricket::MediaEngineInterface* CreateWebRtcMediaEngine( 32 cricket::MediaEngineInterface* CreateWebRtcMediaEngine(
33 webrtc::AudioDeviceModule* adm, 33 webrtc::AudioDeviceModule* adm,
34 webrtc::AudioDeviceModule* adm_sc, 34 webrtc::AudioDeviceModule* adm_sc,
35 cricket::WebRtcVideoEncoderFactory* encoder_factory, 35 cricket::WebRtcVideoEncoderFactory* encoder_factory,
36 cricket::WebRtcVideoDecoderFactory* decoder_factory); 36 cricket::WebRtcVideoDecoderFactory* decoder_factory);
37 37
38 void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine); 38 void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine);
39 39
40 extern "C" { 40 extern "C" {
41 41
42 // Initialize logging, set the forward allocator functions (not on mac), and 42 // Initialize logging, set the forward allocator functions (not on mac), and
43 // return pointers to libjingle's WebRTC factory methods. 43 // return pointers to libjingle's WebRTC factory methods.
44 // Called from init_webrtc.cc. 44 // Called from init_webrtc.cc.
45 ALLOC_EXPORT 45 ALLOC_EXPORT
46 bool InitializeModule(const CommandLine& command_line, 46 bool InitializeModule(const CommandLine& command_line,
47 #if !defined(OS_MACOSX) 47 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
48 AllocateFunction alloc, 48 AllocateFunction alloc,
49 DellocateFunction dealloc, 49 DellocateFunction dealloc,
50 #endif 50 #endif
51 logging::LogMessageHandlerFunction log_handler, 51 logging::LogMessageHandlerFunction log_handler,
52 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, 52 webrtc::GetCategoryEnabledPtr trace_get_category_enabled,
53 webrtc::AddTraceEventPtr trace_add_trace_event, 53 webrtc::AddTraceEventPtr trace_add_trace_event,
54 CreateWebRtcMediaEngineFunction* create_media_engine, 54 CreateWebRtcMediaEngineFunction* create_media_engine,
55 DestroyWebRtcMediaEngineFunction* destroy_media_engine) { 55 DestroyWebRtcMediaEngineFunction* destroy_media_engine) {
56 #if !defined(OS_MACOSX) 56 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
57 g_alloc = alloc; 57 g_alloc = alloc;
58 g_dealloc = dealloc; 58 g_dealloc = dealloc;
59 #endif 59 #endif
60 60
61 *create_media_engine = &CreateWebRtcMediaEngine; 61 *create_media_engine = &CreateWebRtcMediaEngine;
62 *destroy_media_engine = &DestroyWebRtcMediaEngine; 62 *destroy_media_engine = &DestroyWebRtcMediaEngine;
63 63
64 if (CommandLine::Init(0, NULL)) { 64 if (CommandLine::Init(0, NULL)) {
65 #if !defined(OS_WIN) 65 #if !defined(OS_WIN)
66 // This is not needed on Windows since CommandLine::Init has already 66 // This is not needed on Windows since CommandLine::Init has already
67 // done the equivalent thing via the GetCommandLine() API. 67 // done the equivalent thing via the GetCommandLine() API.
68 CommandLine::ForCurrentProcess()->AppendArguments(command_line, true); 68 CommandLine::ForCurrentProcess()->AppendArguments(command_line, true);
69 #endif 69 #endif
70 logging::LoggingSettings settings; 70 logging::LoggingSettings settings;
71 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 71 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
72 logging::InitLogging(settings); 72 logging::InitLogging(settings);
73 73
74 // Override the log message handler to forward logs to chrome's handler. 74 // Override the log message handler to forward logs to chrome's handler.
75 logging::SetLogMessageHandler(log_handler); 75 logging::SetLogMessageHandler(log_handler);
76 webrtc::SetupEventTracer(trace_get_category_enabled, 76 webrtc::SetupEventTracer(trace_get_category_enabled,
77 trace_add_trace_event); 77 trace_add_trace_event);
78 } 78 }
79 79
80 return true; 80 return true;
81 } 81 }
82 } // extern "C" 82 } // extern "C"
OLDNEW
« no previous file with comments | « third_party/libjingle/overrides/init_webrtc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698