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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp

Issue 1987203002: Remove OwnPtr::release(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with trunk for landing. Created 4 years, 7 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "modules/fetch/BodyStreamBuffer.h" 5 #include "modules/fetch/BodyStreamBuffer.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "bindings/core/v8/V8HiddenValue.h" 8 #include "bindings/core/v8/V8HiddenValue.h"
9 #include "core/dom/DOMArrayBuffer.h" 9 #include "core/dom/DOMArrayBuffer.h"
10 #include "core/dom/DOMTypedArray.h" 10 #include "core/dom/DOMTypedArray.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // - This branch cannot be taken when called from tee. 421 // - This branch cannot be taken when called from tee.
422 // - startLoading makes hasPendingActivity return true while loading. 422 // - startLoading makes hasPendingActivity return true while loading.
423 // , we don't need to keep the reader explicitly. 423 // , we don't need to keep the reader explicitly.
424 NonThrowableExceptionState exceptionState; 424 NonThrowableExceptionState exceptionState;
425 ScriptValue reader = ReadableStreamOperations::getReader(m_scriptState.g et(), stream(), exceptionState); 425 ScriptValue reader = ReadableStreamOperations::getReader(m_scriptState.g et(), stream(), exceptionState);
426 return ReadableStreamDataConsumerHandle::create(m_scriptState.get(), rea der); 426 return ReadableStreamDataConsumerHandle::create(m_scriptState.get(), rea der);
427 } 427 }
428 // We need to call these before calling closeAndLockAndDisturb. 428 // We need to call these before calling closeAndLockAndDisturb.
429 const bool isClosed = isStreamClosed(); 429 const bool isClosed = isStreamClosed();
430 const bool isErrored = isStreamErrored(); 430 const bool isErrored = isStreamErrored();
431 OwnPtr<FetchDataConsumerHandle> handle = m_handle.release(); 431 OwnPtr<FetchDataConsumerHandle> handle = std::move(m_handle);
432 432
433 closeAndLockAndDisturb(); 433 closeAndLockAndDisturb();
434 434
435 if (isClosed) { 435 if (isClosed) {
436 // Note that the stream cannot be "draining", because it doesn't have 436 // Note that the stream cannot be "draining", because it doesn't have
437 // the internal buffer. 437 // the internal buffer.
438 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle()); 438 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle());
439 } 439 }
440 if (isErrored) 440 if (isErrored)
441 return createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorD ataConsumerHandle()); 441 return createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorD ataConsumerHandle());
442 442
443 DCHECK(handle); 443 DCHECK(handle);
444 return handle; 444 return handle;
445 } 445 }
446 446
447 } // namespace blink 447 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698