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

Side by Side Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 89243003: Move EmptyString, kWhitespace and the BOM to base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/chrome_render_view_observer.h" 5 #include "chrome/renderer/chrome_render_view_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 char buf[128]; 964 char buf[128];
965 sprintf_s(buf, "%d chars retrieved for indexing in %gms\n", 965 sprintf_s(buf, "%d chars retrieved for indexing in %gms\n",
966 contents.size(), (end - begin)*1000); 966 contents.size(), (end - begin)*1000);
967 OutputDebugStringA(buf); 967 OutputDebugStringA(buf);
968 #endif 968 #endif
969 969
970 // When the contents are clipped to the maximum, we don't want to have a 970 // When the contents are clipped to the maximum, we don't want to have a
971 // partial word indexed at the end that might have been clipped. Therefore, 971 // partial word indexed at the end that might have been clipped. Therefore,
972 // terminate the string at the last space to ensure no words are clipped. 972 // terminate the string at the last space to ensure no words are clipped.
973 if (contents->size() == kMaxIndexChars) { 973 if (contents->size() == kMaxIndexChars) {
974 size_t last_space_index = contents->find_last_of(kWhitespaceUTF16); 974 size_t last_space_index = contents->find_last_of(base::kWhitespaceUTF16);
975 if (last_space_index == std::wstring::npos) 975 if (last_space_index == base::string16::npos)
976 return; // don't index if we got a huge block of text with no spaces 976 return; // don't index if we got a huge block of text with no spaces
977 contents->resize(last_space_index); 977 contents->resize(last_space_index);
978 } 978 }
979 } 979 }
980 980
981 ExternalHostBindings* ChromeRenderViewObserver::GetExternalHostBindings() { 981 ExternalHostBindings* ChromeRenderViewObserver::GetExternalHostBindings() {
982 if (!external_host_bindings_.get()) { 982 if (!external_host_bindings_.get()) {
983 external_host_bindings_.reset(new ExternalHostBindings( 983 external_host_bindings_.reset(new ExternalHostBindings(
984 render_view(), routing_id())); 984 render_view(), routing_id()));
985 } 985 }
(...skipping 30 matching lines...) Expand all
1016 WebElement element = node.to<WebElement>(); 1016 WebElement element = node.to<WebElement>();
1017 if (!element.hasTagName(tag_name)) 1017 if (!element.hasTagName(tag_name))
1018 continue; 1018 continue;
1019 WebString value = element.getAttribute(attribute_name); 1019 WebString value = element.getAttribute(attribute_name);
1020 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) 1020 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh"))
1021 continue; 1021 continue;
1022 return true; 1022 return true;
1023 } 1023 }
1024 return false; 1024 return false;
1025 } 1025 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/permissions/socket_permission_entry.cc ('k') | chrome_frame/chrome_active_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698