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

Side by Side Diff: content/child/npapi/plugin_lib.cc

Issue 206713004: Report PPAPI plugin load error code to UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use std::string directly. Created 6 years, 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/child/npapi/plugin_lib.h" 5 #include "content/child/npapi/plugin_lib.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.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 "base/metrics/stats_counters.h" 10 #include "base/metrics/stats_counters.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if ((instance_count_ == 0) && !defer_unload_) 164 if ((instance_count_ == 0) && !defer_unload_)
165 Unload(); 165 Unload();
166 } 166 }
167 167
168 bool PluginLib::Load() { 168 bool PluginLib::Load() {
169 if (library_) 169 if (library_)
170 return true; 170 return true;
171 171
172 bool rv = false; 172 bool rv = false;
173 base::NativeLibrary library = 0; 173 base::NativeLibrary library = 0;
174 std::string error; 174 base::NativeLibraryLoadError error = 0;
175 175
176 #if defined(OS_WIN) 176 #if defined(OS_WIN)
177 // This is to work around a bug in the Real player recorder plugin which 177 // This is to work around a bug in the Real player recorder plugin which
178 // intercepts LoadLibrary calls from chrome.dll and wraps NPAPI functions 178 // intercepts LoadLibrary calls from chrome.dll and wraps NPAPI functions
179 // provided by the plugin. It crashes if the media player plugin is being 179 // provided by the plugin. It crashes if the media player plugin is being
180 // loaded. Workaround is to load the dll dynamically by getting the 180 // loaded. Workaround is to load the dll dynamically by getting the
181 // LoadLibrary API address from kernel32.dll which bypasses the recorder 181 // LoadLibrary API address from kernel32.dll which bypasses the recorder
182 // plugin. 182 // plugin.
183 if (web_plugin_info_.name.find(L"Windows Media Player") != 183 if (web_plugin_info_.name.find(L"Windows Media Player") !=
184 std::wstring::npos) { 184 std::wstring::npos) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 329
330 void PluginLib::Shutdown() { 330 void PluginLib::Shutdown() {
331 if (initialized_) { 331 if (initialized_) {
332 NP_Shutdown(); 332 NP_Shutdown();
333 initialized_ = false; 333 initialized_ = false;
334 } 334 }
335 } 335 }
336 336
337 } // namespace content 337 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698