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

Side by Side Diff: content/browser/debugger/devtools_http_protocol_handler.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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
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/browser/debugger/devtools_http_protocol_handler.h" 5 #include "content/browser/debugger/devtools_http_protocol_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 id_to_tabcontents_; 129 id_to_tabcontents_;
130 typedef std::map<TabContents*, int> TabContentsToIdMap; 130 typedef std::map<TabContents*, int> TabContentsToIdMap;
131 static base::LazyInstance<TabContentsToIdMap, 131 static base::LazyInstance<TabContentsToIdMap,
132 base::LeakyLazyInstanceTraits<TabContentsToIdMap> > 132 base::LeakyLazyInstanceTraits<TabContentsToIdMap> >
133 tabcontents_to_id_; 133 tabcontents_to_id_;
134 }; 134 };
135 135
136 base::LazyInstance< 136 base::LazyInstance<
137 TabContentsIDHelper::IdToTabContentsMap, 137 TabContentsIDHelper::IdToTabContentsMap,
138 base::LeakyLazyInstanceTraits<TabContentsIDHelper::IdToTabContentsMap> > 138 base::LeakyLazyInstanceTraits<TabContentsIDHelper::IdToTabContentsMap> >
139 TabContentsIDHelper::id_to_tabcontents_(base::LINKER_INITIALIZED); 139 TabContentsIDHelper::id_to_tabcontents_ = LAZY_INSTANCE_INITIALIZER;
140 base::LazyInstance< 140 base::LazyInstance<
141 TabContentsIDHelper::TabContentsToIdMap, 141 TabContentsIDHelper::TabContentsToIdMap,
142 base::LeakyLazyInstanceTraits<TabContentsIDHelper::TabContentsToIdMap> > 142 base::LeakyLazyInstanceTraits<TabContentsIDHelper::TabContentsToIdMap> >
143 TabContentsIDHelper::tabcontents_to_id_(base::LINKER_INITIALIZED); 143 TabContentsIDHelper::tabcontents_to_id_ = LAZY_INSTANCE_INITIALIZER;
144 144
145 } // namespace 145 } // namespace
146 146
147 // static 147 // static
148 scoped_refptr<DevToolsHttpProtocolHandler> DevToolsHttpProtocolHandler::Start( 148 scoped_refptr<DevToolsHttpProtocolHandler> DevToolsHttpProtocolHandler::Start(
149 const std::string& ip, 149 const std::string& ip,
150 int port, 150 int port,
151 const std::string& frontend_url, 151 const std::string& frontend_url,
152 Delegate* delegate) { 152 Delegate* delegate) {
153 scoped_refptr<DevToolsHttpProtocolHandler> http_handler = 153 scoped_refptr<DevToolsHttpProtocolHandler> http_handler =
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 549 }
550 550
551 void DevToolsHttpProtocolHandler::AcceptWebSocket( 551 void DevToolsHttpProtocolHandler::AcceptWebSocket(
552 int connection_id, 552 int connection_id,
553 const net::HttpServerRequestInfo& request) { 553 const net::HttpServerRequestInfo& request) {
554 BrowserThread::PostTask( 554 BrowserThread::PostTask(
555 BrowserThread::IO, FROM_HERE, 555 BrowserThread::IO, FROM_HERE,
556 base::Bind(&net::HttpServer::AcceptWebSocket, server_.get(), 556 base::Bind(&net::HttpServer::AcceptWebSocket, server_.get(),
557 connection_id, request)); 557 connection_id, request));
558 } 558 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698