Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 ScopedDisposal<Range> disposeScope(range); | |
| 260 | |
| 259 TrackExceptionState exceptionState; | 261 TrackExceptionState exceptionState; |
| 260 range->selectNodeContents(document->body(), exceptionState); | 262 range->selectNodeContents(document->body(), exceptionState); |
|
yosin_UTC9
2015/09/11 01:22:27
We can use |EphemeralRange| here.
// ClusterFuzz
sof
2015/09/11 06:32:12
Nice; done, I think.
| |
| 261 | 263 |
| 262 if (!exceptionState.hadException()) { | 264 if (!exceptionState.hadException()) { |
| 263 // The text iterator will walk nodes giving us text. This is similar to | 265 // 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 | 266 // 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 | 267 // size and also copy the results directly into a wstring, avoiding the |
| 266 // string conversion. | 268 // string conversion. |
| 267 for (TextIterator it(range->startPosition(), range->endPosition()); !it. atEnd(); it.advance()) { | 269 for (TextIterator it(range->startPosition(), range->endPosition()); !it. atEnd(); it.advance()) { |
| 268 it.text().appendTextToStringBuilder(output, 0, maxChars - output.len gth()); | 270 it.text().appendTextToStringBuilder(output, 0, maxChars - output.len gth()); |
| 269 if (output.length() >= maxChars) | 271 if (output.length() >= maxChars) |
| 270 return; // Filled up the buffer. | 272 return; // Filled up the buffer. |
| (...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2193 } | 2195 } |
| 2194 | 2196 |
| 2195 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2197 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
| 2196 { | 2198 { |
| 2197 if (!frame()) | 2199 if (!frame()) |
| 2198 return WebSandboxFlags::None; | 2200 return WebSandboxFlags::None; |
| 2199 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); | 2201 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); |
| 2200 } | 2202 } |
| 2201 | 2203 |
| 2202 } // namespace blink | 2204 } // namespace blink |
| OLD | NEW |