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

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

Issue 11506: Make the net resource interface use StringPiece instead of std::string. This... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | « no previous file | net/base/net_module.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <shellapi.h> 6 #include <shellapi.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 "t"); 110 "t");
111 } 111 }
112 112
113 std::string html_data; 113 std::string html_data;
114 }; 114 };
115 115
116 base::LazyInstance<LazyDirectoryListerCacher> lazy_dir_lister( 116 base::LazyInstance<LazyDirectoryListerCacher> lazy_dir_lister(
117 base::LINKER_INITIALIZED); 117 base::LINKER_INITIALIZED);
118 118
119 // This is called indirectly by the network layer to access resources. 119 // This is called indirectly by the network layer to access resources.
120 std::string NetResourceProvider(int key) { 120 StringPiece NetResourceProvider(int key) {
121 if (IDR_DIR_HEADER_HTML == key) 121 if (IDR_DIR_HEADER_HTML == key)
122 return lazy_dir_lister.Pointer()->html_data; 122 return StringPiece(lazy_dir_lister.Pointer()->html_data);
123 123
124 return ResourceBundle::GetSharedInstance().GetDataResource(key); 124 return ResourceBundle::GetSharedInstance().GetRawDataResource(key);
125 } 125 }
126 126
127 // Displays a warning message if the user is running chrome on windows 2000. 127 // Displays a warning message if the user is running chrome on windows 2000.
128 // Returns true if the OS is win2000, false otherwise. 128 // Returns true if the OS is win2000, false otherwise.
129 bool CheckForWin2000() { 129 bool CheckForWin2000() {
130 if (win_util::GetWinVersion() == win_util::WINVERSION_2000) { 130 if (win_util::GetWinVersion() == win_util::WINVERSION_2000) {
131 const std::wstring text = l10n_util::GetString(IDS_UNSUPPORTED_OS_WIN2000); 131 const std::wstring text = l10n_util::GetString(IDS_UNSUPPORTED_OS_WIN2000);
132 const std::wstring caption = l10n_util::GetString(IDS_PRODUCT_NAME); 132 const std::wstring caption = l10n_util::GetString(IDS_PRODUCT_NAME);
133 win_util::MessageBox(NULL, text, caption, 133 win_util::MessageBox(NULL, text, caption,
134 MB_OK | MB_ICONWARNING | MB_TOPMOST); 134 MB_OK | MB_ICONWARNING | MB_TOPMOST);
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // The following should ONLY be called when in single threaded mode. It is 601 // The following should ONLY be called when in single threaded mode. It is
602 // unsafe to do this cleanup if other threads are still active. 602 // unsafe to do this cleanup if other threads are still active.
603 // It is also very unnecessary, so I'm only doing this in debug to satisfy 603 // It is also very unnecessary, so I'm only doing this in debug to satisfy
604 // purify. 604 // purify.
605 if (tracking_objects) 605 if (tracking_objects)
606 tracked_objects::ThreadData::ShutdownSingleThreadedCleanup(); 606 tracked_objects::ThreadData::ShutdownSingleThreadedCleanup();
607 #endif // NDEBUG 607 #endif // NDEBUG
608 608
609 return result_code; 609 return result_code;
610 } 610 }
OLDNEW
« no previous file with comments | « no previous file | net/base/net_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698