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

Side by Side Diff: third_party/WebKit/Source/core/mojo/MojoHandle.cpp

Issue 2848243004: Clean up bindings/core/v8 (Part 2) (Closed)
Patch Set: Rebase Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "core/mojo/MojoHandle.h" 5 #include "core/mojo/MojoHandle.h"
6 6
7 #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h" 7 #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h"
8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
10 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
11 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
12 #include "core/mojo/MojoCreateSharedBufferResult.h" 11 #include "core/mojo/MojoCreateSharedBufferResult.h"
13 #include "core/mojo/MojoDiscardDataOptions.h" 12 #include "core/mojo/MojoDiscardDataOptions.h"
14 #include "core/mojo/MojoDuplicateBufferHandleOptions.h" 13 #include "core/mojo/MojoDuplicateBufferHandleOptions.h"
15 #include "core/mojo/MojoMapBufferResult.h" 14 #include "core/mojo/MojoMapBufferResult.h"
16 #include "core/mojo/MojoReadDataOptions.h" 15 #include "core/mojo/MojoReadDataOptions.h"
17 #include "core/mojo/MojoReadDataResult.h" 16 #include "core/mojo/MojoReadDataResult.h"
18 #include "core/mojo/MojoReadMessageFlags.h" 17 #include "core/mojo/MojoReadMessageFlags.h"
19 #include "core/mojo/MojoReadMessageResult.h" 18 #include "core/mojo/MojoReadMessageResult.h"
20 #include "core/mojo/MojoWatcher.h" 19 #include "core/mojo/MojoWatcher.h"
21 #include "core/mojo/MojoWriteDataOptions.h" 20 #include "core/mojo/MojoWriteDataOptions.h"
22 #include "core/mojo/MojoWriteDataResult.h" 21 #include "core/mojo/MojoWriteDataResult.h"
22 #include "platform/bindings/ScriptState.h"
23 23
24 // Mojo messages typically do not contain many handles. In fact most 24 // Mojo messages typically do not contain many handles. In fact most
25 // messages do not contain any handle. An inline capacity of 4 should avoid 25 // messages do not contain any handle. An inline capacity of 4 should avoid
26 // heap allocation in vast majority of cases. 26 // heap allocation in vast majority of cases.
27 static const size_t kHandleVectorInlineCapacity = 4; 27 static const size_t kHandleVectorInlineCapacity = 4;
28 28
29 namespace blink { 29 namespace blink {
30 30
31 MojoHandle* MojoHandle::Create(mojo::ScopedHandle handle) { 31 MojoHandle* MojoHandle::Create(mojo::ScopedHandle handle) {
32 return new MojoHandle(std::move(handle)); 32 return new MojoHandle(std::move(handle));
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 mojo::Handle handle; 206 mojo::Handle handle;
207 MojoResult result = MojoDuplicateBufferHandle(handle_->value(), &options, 207 MojoResult result = MojoDuplicateBufferHandle(handle_->value(), &options,
208 handle.mutable_value()); 208 handle.mutable_value());
209 result_dict.setResult(result); 209 result_dict.setResult(result);
210 if (result == MOJO_RESULT_OK) { 210 if (result == MOJO_RESULT_OK) {
211 result_dict.setHandle(MojoHandle::Create(mojo::MakeScopedHandle(handle))); 211 result_dict.setHandle(MojoHandle::Create(mojo::MakeScopedHandle(handle)));
212 } 212 }
213 } 213 }
214 214
215 } // namespace blink 215 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/mojo/MojoHandle.h ('k') | third_party/WebKit/Source/core/mojo/MojoWatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698