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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO Created 3 years, 8 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/presentation/PresentationConnection.h" 5 #include "modules/presentation/PresentationConnection.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void PresentationConnection::send(DOMArrayBuffer* array_buffer, 275 void PresentationConnection::send(DOMArrayBuffer* array_buffer,
276 ExceptionState& exception_state) { 276 ExceptionState& exception_state) {
277 ASSERT(array_buffer && array_buffer->Buffer()); 277 ASSERT(array_buffer && array_buffer->Buffer());
278 if (!CanSendMessage(exception_state)) 278 if (!CanSendMessage(exception_state))
279 return; 279 return;
280 280
281 messages_.push_back(new Message(array_buffer)); 281 messages_.push_back(new Message(array_buffer));
282 HandleMessageQueue(); 282 HandleMessageQueue();
283 } 283 }
284 284
285 void PresentationConnection::send(DOMArrayBufferView* array_buffer_view, 285 void PresentationConnection::send(
286 ExceptionState& exception_state) { 286 NotShared<DOMArrayBufferView> array_buffer_view,
287 ASSERT(array_buffer_view); 287 ExceptionState& exception_state) {
288 DCHECK(array_buffer_view);
288 if (!CanSendMessage(exception_state)) 289 if (!CanSendMessage(exception_state))
289 return; 290 return;
290 291
291 messages_.push_back(new Message(array_buffer_view->buffer())); 292 messages_.push_back(new Message(array_buffer_view.View()->buffer()));
292 HandleMessageQueue(); 293 HandleMessageQueue();
293 } 294 }
294 295
295 void PresentationConnection::send(Blob* data, ExceptionState& exception_state) { 296 void PresentationConnection::send(Blob* data, ExceptionState& exception_state) {
296 ASSERT(data); 297 ASSERT(data);
297 if (!CanSendMessage(exception_state)) 298 if (!CanSendMessage(exception_state))
298 return; 299 return;
299 300
300 messages_.push_back(new Message(data->GetBlobDataHandle())); 301 messages_.push_back(new Message(data->GetBlobDataHandle()));
301 HandleMessageQueue(); 302 HandleMessageQueue();
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 void PresentationConnection::TearDown() { 518 void PresentationConnection::TearDown() {
518 // Cancel current Blob loading if any. 519 // Cancel current Blob loading if any.
519 if (blob_loader_) { 520 if (blob_loader_) {
520 blob_loader_->Cancel(); 521 blob_loader_->Cancel();
521 blob_loader_.Clear(); 522 blob_loader_.Clear();
522 } 523 }
523 messages_.Clear(); 524 messages_.Clear();
524 } 525 }
525 526
526 } // namespace blink 527 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698