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

Side by Side Diff: webkit/glue/webkit_glue.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
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 "webkit/glue/webkit_glue.h" 5 #include "webkit/glue/webkit_glue.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <objidl.h> 8 #include <objidl.h>
9 #include <mlang.h> 9 #include <mlang.h>
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 BuildUserAgentFromProduct("Version/5.0.4 Safari/533.20.27"); 404 BuildUserAgentFromProduct("Version/5.0.4 Safari/533.20.27");
405 } 405 }
406 return mimic_mac_safari_user_agent_; 406 return mimic_mac_safari_user_agent_;
407 } 407 }
408 #endif 408 #endif
409 } 409 }
410 410
411 return user_agent_; 411 return user_agent_;
412 } 412 }
413 413
414 base::LazyInstance<UserAgentState> g_user_agent(base::LINKER_INITIALIZED); 414 base::LazyInstance<UserAgentState> g_user_agent = LAZY_INSTANCE_INITIALIZER;
415 415
416 } // namespace 416 } // namespace
417 417
418 void SetUserAgent(const std::string& user_agent, bool overriding) { 418 void SetUserAgent(const std::string& user_agent, bool overriding) {
419 g_user_agent.Get().Set(user_agent, overriding); 419 g_user_agent.Get().Set(user_agent, overriding);
420 } 420 }
421 421
422 const std::string& GetUserAgent(const GURL& url) { 422 const std::string& GetUserAgent(const GURL& url) {
423 return g_user_agent.Get().Get(url); 423 return g_user_agent.Get().Get(url);
424 } 424 }
(...skipping 24 matching lines...) Expand all
449 std::string GetInspectorProtocolVersion() { 449 std::string GetInspectorProtocolVersion() {
450 return WebDevToolsAgent::inspectorProtocolVersion().utf8(); 450 return WebDevToolsAgent::inspectorProtocolVersion().utf8();
451 } 451 }
452 452
453 bool IsInspectorProtocolVersionSupported(const std::string& version) { 453 bool IsInspectorProtocolVersionSupported(const std::string& version) {
454 return WebDevToolsAgent::supportsInspectorProtocolVersion( 454 return WebDevToolsAgent::supportsInspectorProtocolVersion(
455 WebString::fromUTF8(version)); 455 WebString::fromUTF8(version));
456 } 456 }
457 457
458 } // namespace webkit_glue 458 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/blob/deletable_file_reference.cc ('k') | webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698