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

Side by Side Diff: content/plugin/plugin_thread.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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 | « content/common/socket_stream_dispatcher.cc ('k') | content/public/renderer/render_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/plugin/plugin_thread.h" 5 #include "content/plugin/plugin_thread.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(TOOLKIT_USES_GTK) 9 #if defined(TOOLKIT_USES_GTK)
10 #include <gtk/gtk.h> 10 #include <gtk/gtk.h>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 kPluginProcessTerminateTimeoutMs); 58 kPluginProcessTerminateTimeoutMs);
59 } 59 }
60 60
61 void Terminate() { 61 void Terminate() {
62 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 62 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
63 } 63 }
64 }; 64 };
65 65
66 } // namespace 66 } // namespace
67 67
68 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( 68 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls =
69 base::LINKER_INITIALIZED); 69 LAZY_INSTANCE_INITIALIZER;
70 70
71 PluginThread::PluginThread() 71 PluginThread::PluginThread()
72 : preloaded_plugin_module_(NULL) { 72 : preloaded_plugin_module_(NULL) {
73 FilePath plugin_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( 73 FilePath plugin_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
74 switches::kPluginPath); 74 switches::kPluginPath);
75 75
76 lazy_tls.Pointer()->Set(this); 76 lazy_tls.Pointer()->Set(this);
77 #if defined(USE_AURA) 77 #if defined(USE_AURA)
78 // TODO(saintlou): 78 // TODO(saintlou):
79 #elif defined(TOOLKIT_USES_GTK) 79 #elif defined(TOOLKIT_USES_GTK)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 #endif 167 #endif
168 channel->set_incognito(incognito); 168 channel->set_incognito(incognito);
169 } 169 }
170 170
171 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); 171 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle));
172 } 172 }
173 173
174 void PluginThread::OnNotifyRenderersOfPendingShutdown() { 174 void PluginThread::OnNotifyRenderersOfPendingShutdown() {
175 PluginChannel::NotifyRenderersOfPendingShutdown(); 175 PluginChannel::NotifyRenderersOfPendingShutdown();
176 } 176 }
OLDNEW
« no previous file with comments | « content/common/socket_stream_dispatcher.cc ('k') | content/public/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698