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

Unified Diff: content/browser/renderer_host/text_input_client_mac.mm

Issue 1326763003: Clean up the useless GetAttributedSubstringFromRange() and the related IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/text_input_client_mac.mm
diff --git a/content/browser/renderer_host/text_input_client_mac.mm b/content/browser/renderer_host/text_input_client_mac.mm
index 58bf35fa8412c048e1969c8797c9723e85e2844e..4a09837a75256ab9936dc2e11df91eed71e066b1 100644
--- a/content/browser/renderer_host/text_input_client_mac.mm
+++ b/content/browser/renderer_host/text_input_client_mac.mm
@@ -64,7 +64,6 @@ void TextInputClientMac::GetStringFromRange(
void TextInputClientMac::GetStringFromRangeReply(NSAttributedString* string,
NSPoint point) {
- SetSubstringAndSignal(string);
if (replyForRangeHandler_.get()) {
replyForRangeHandler_.get()(string, point);
replyForRangeHandler_.reset();
@@ -112,30 +111,6 @@ NSRect TextInputClientMac::GetFirstRectForRange(RenderWidgetHost* rwh,
return first_rect_;
}
-NSAttributedString* TextInputClientMac::GetAttributedSubstringFromRange(
- RenderWidgetHost* rwh,
- NSRange range) {
- base::TimeTicks start = base::TimeTicks::Now();
-
- BeforeRequest();
- RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
- rwhi->Send(new TextInputClientMsg_StringForRange(rwhi->GetRoutingID(),
- gfx::Range(range)));
- // http://crbug.com/121917
- base::ThreadRestrictions::ScopedAllowWait allow_wait;
- condition_.TimedWait(base::TimeDelta::FromMilliseconds(kWaitTimeout));
- AfterRequest();
-
- base::TimeDelta delta(base::TimeTicks::Now() - start);
- UMA_HISTOGRAM_LONG_TIMES("TextInputClient.Substring",
- delta * base::Time::kMicrosecondsPerMillisecond);
-
- // Lookup.framework calls this method repeatedly and expects that repeated
- // calls don't deallocate previous results immediately. Returning an
- // autoreleased string is better convention anyway.
- return [[substring_.get() retain] autorelease];
-}
-
void TextInputClientMac::SetCharacterIndexAndSignal(NSUInteger index) {
lock_.Acquire();
character_index_ = index;
@@ -150,13 +125,6 @@ void TextInputClientMac::SetFirstRectAndSignal(NSRect first_rect) {
condition_.Signal();
}
-void TextInputClientMac::SetSubstringAndSignal(NSAttributedString* string) {
- lock_.Acquire();
- substring_.reset([string copy]);
- lock_.Release();
- condition_.Signal();
-}
-
void TextInputClientMac::BeforeRequest() {
base::TimeTicks start = base::TimeTicks::Now();
@@ -168,7 +136,6 @@ void TextInputClientMac::BeforeRequest() {
character_index_ = NSNotFound;
first_rect_ = NSZeroRect;
- substring_.reset();
}
void TextInputClientMac::AfterRequest() {
« no previous file with comments | « content/browser/renderer_host/text_input_client_mac.h ('k') | content/browser/renderer_host/text_input_client_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698