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

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1329253002: WIP: prefer using EphemeralRange for SpellChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use ScopedDisposal<T> 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 { 249 {
250 Document* document = frame->document(); 250 Document* document = frame->document();
251 if (!document) 251 if (!document)
252 return; 252 return;
253 253
254 if (!frame->view()) 254 if (!frame->view())
255 return; 255 return;
256 256
257 // Select the document body. 257 // Select the document body.
258 RefPtrWillBeRawPtr<Range> range(document->createRange()); 258 RefPtrWillBeRawPtr<Range> range(document->createRange());
259 #if ENABLE(OILPAN)
260 ScopedDisposal<Range> disposeScope(range);
261 #endif
262
259 TrackExceptionState exceptionState; 263 TrackExceptionState exceptionState;
260 range->selectNodeContents(document->body(), exceptionState); 264 range->selectNodeContents(document->body(), exceptionState);
261 265
262 if (!exceptionState.hadException()) { 266 if (!exceptionState.hadException()) {
263 // The text iterator will walk nodes giving us text. This is similar to 267 // The text iterator will walk nodes giving us text. This is similar to
264 // the plainText() function in core/editing/TextIterator.h, but we imple ment the maximum 268 // the plainText() function in core/editing/TextIterator.h, but we imple ment the maximum
265 // size and also copy the results directly into a wstring, avoiding the 269 // size and also copy the results directly into a wstring, avoiding the
266 // string conversion. 270 // string conversion.
267 for (TextIterator it(range->startPosition(), range->endPosition()); !it. atEnd(); it.advance()) { 271 for (TextIterator it(range->startPosition(), range->endPosition()); !it. atEnd(); it.advance()) {
268 it.text().appendTextToStringBuilder(output, 0, maxChars - output.len gth()); 272 it.text().appendTextToStringBuilder(output, 0, maxChars - output.len gth());
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 } 2197 }
2194 2198
2195 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2199 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2196 { 2200 {
2197 if (!frame()) 2201 if (!frame())
2198 return WebSandboxFlags::None; 2202 return WebSandboxFlags::None;
2199 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2203 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2200 } 2204 }
2201 2205
2202 } // namespace blink 2206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698