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

Side by Side Diff: chrome/browser/plugin_process_host.cc

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/plugin_process_host.h" 5 #include "chrome/browser/plugin_process_host.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <utility> // for pair<> 10 #include <utility> // for pair<>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void PluginProcessHost::AddWindow(HWND window) { 80 void PluginProcessHost::AddWindow(HWND window) {
81 plugin_parent_windows_set_.insert(window); 81 plugin_parent_windows_set_.insert(window);
82 } 82 }
83 83
84 #endif // defined(OS_WIN) 84 #endif // defined(OS_WIN)
85 85
86 #if defined(TOOLKIT_USES_GTK) 86 #if defined(TOOLKIT_USES_GTK)
87 void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id, 87 void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id,
88 gfx::PluginWindowHandle* output) { 88 gfx::PluginWindowHandle* output) {
89 *output = 0; 89 *output = 0;
90 Singleton<GtkNativeViewManager>()->GetXIDForId(output, id); 90 GtkNativeViewManager::GetInstance()->GetXIDForId(output, id);
91 } 91 }
92 #endif // defined(TOOLKIT_USES_GTK) 92 #endif // defined(TOOLKIT_USES_GTK)
93 93
94 PluginProcessHost::PluginProcessHost() 94 PluginProcessHost::PluginProcessHost()
95 : BrowserChildProcessHost( 95 : BrowserChildProcessHost(
96 PLUGIN_PROCESS, 96 PLUGIN_PROCESS,
97 PluginService::GetInstance()->resource_dispatcher_host()), 97 PluginService::GetInstance()->resource_dispatcher_host()),
98 ALLOW_THIS_IN_INITIALIZER_LIST(resolve_proxy_msg_helper_(this, NULL)) 98 ALLOW_THIS_IN_INITIALIZER_LIST(resolve_proxy_msg_helper_(this, NULL))
99 #if defined(OS_MACOSX) 99 #if defined(OS_MACOSX)
100 , plugin_cursor_visible_(true) 100 , plugin_cursor_visible_(true)
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 const std::vector<uint8>& data) { 441 const std::vector<uint8>& data) {
442 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 442 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
443 443
444 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); 444 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path);
445 if (chrome_plugin) { 445 if (chrome_plugin) {
446 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); 446 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0]));
447 uint32 data_len = static_cast<uint32>(data.size()); 447 uint32 data_len = static_cast<uint32>(data.size());
448 chrome_plugin->functions().on_message(data_ptr, data_len); 448 chrome_plugin->functions().on_message(data_ptr, data_len);
449 } 449 }
450 } 450 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698